【问题标题】:Advice needed: simple cross platform (OS-X and Windows) + SQLite development without installation需要的建议:简单的跨平台(OS-X 和 Windows)+ 无需安装的 SQLite 开发
【发布时间】:2013-07-02 18:08:14
【问题描述】:
需要针对 OS-X 和 Windows + SQLite 的跨平台开发环境的建议
我需要在 OS-X 和 Windows 机器上运行一个简单的维护程序,以便一次更新 SQLite 数据库。
用例:
在 OS-X 和 Windows 上对应用程序的 SQLite 数据库进行数据库维护。
要求
- 用于选择 SQLite 数据库并选择目录的文件对话框的简单 GUI
- 不安装运行时环境。
- Windows 和 OS-X 的代码相同
- 这就是我不喜欢 Java 的原因,因为在新版本的 OS-X 上没有安装 Java
- 支持 SQLite。需要运行几个 SQL 脚本,基于一些逻辑
- 用户应该只启动和停止应用程序,在他系统的某个地方选择一个本地 SQLite 数据库并启动维护程序 = 脚本。
- (数据库管理工具对用户来说太复杂了)
- 开源、免费软件或免费用于商业用途
这是一次性维护,所以应该尽可能简单
我最适合使用哪种开发环境?
【问题讨论】:
标签:
windows
macos
sqlite
cross-platform
development-environment
【解决方案1】:
Xojo 会做你需要的一切。它可以创建不需要 Windows 和 OS X 运行时的独立应用程序。它还具有对 SQLite 的内置支持。
它可以免费用于开发,但您需要许可证才能创建用于部署的构建。
http://www.xojo.com
【解决方案2】:
我建议你使用 Tcl/Tk。
- SQlite began as Tcl extension
- SQlite 扩展由 SQlite 作者维护。
- Tcl/Tk 可用于许多平台。
- Tk 是一个旧的但仍在维护、不断发展的 GUI 工具包。
- 您可以将代码包装在 Starpack 中,这是一个包含所有内容的单个可执行文件:Tcl/Tk 运行时、SQlite 扩展、您的脚本。
- Tcl/Tk 是在 BSD 样式许可下获得许可的。
这里是 GUI 的示例脚本。
package require Tk
package require sqlite3
ttk::label .lbldb -text "Database:"
ttk::entry .db -textvariable db
set db {}
ttk::button .seldb -command seldb -text "..."
grid .lbldb .db .seldb -sticky nesw -columnspan 2
ttk::label .lbldir -text "Directory:"
ttk::entry .dir -textvariable dir
set dir {}
ttk::button .seldir -command seldir -text "..."
grid .lbldir .dir .seldir -sticky nesw -columnspan 2
ttk::button .go -command go -text "Go!" -default active
ttk::button .exit -command exit -text "Exit"
grid .go .exit -sticky nesw -columnspan 3
grid columnconfigure . 2 -weight 1
grid columnconfigure . 3 -weight 1
grid rowconfigure . 2 -weight 1
proc seldb {} {
set res [tk_getOpenFile -initialfile $::db]
if {$res ne {}} {
set ::db $res
}
}
proc seldir {} {
set res [tk_chooseDirectory -initialdir $::dir]
if {$res ne {}} {
set ::dir $res
}
}
proc go {} {
# Connect with the database
sqlite3 db $::db
# Do some stuff...
}