我想在Ruby上使用新的数据库。
该数据库是HSQLDB。
我该如何使用?
答案 0 :(得分:2)
最简单的方法可能是使用JRuby,因为HSQLDB是一个Java数据库。
否则,请尝试http://www.infoq.com/news/ruby-driver-hsqldb和http://rubyforge.org/projects/hypersonic/
您可能还想查看SQLite而不是HSQLDB,因为它们类似,但SQLite不是用Java编写的。
来自http://www.sqlite.org/whentouse.html
With the default page size of 1024 bytes, an SQLite database is limited in size to 2 terabytes (2^41 bytes). And even if it could handle larger databases, SQLite stores the entire database in a single disk file and many filesystems limit the maximum size of files to something less than this. So if you are contemplating databases of this magnitude, you would do well to consider using a client/server database engine that spreads its content across multiple disk files, and perhaps across multiple volumes.
阅读该页面的其余部分,看看它是否符合您的需求。
您可能会发现其他两个有用的页面:
http://www.sqlite.org/faq.html
http://www.sqlite.org/mostdeployed.html
答案 1 :(得分:0)
如果你在JRuby上:
1-从here下载hsqldb驱动程序并将hsqldb.jar添加到/ lib
2-在项目的config/database.yml
文件中:
...
development:
database: db_name
adapter: jdbc
driver: org.hsqldb.jdbc.JDBCDriver
schema: K12_EDUCATION
url: jdbc:hsqldb:file:./db_files/db_name