How to create a new SQLite3 database using Ruby?

1.6k views Asked by At

I know how to connect to a database in the current file directory:

db = SQLite3::Database.new 'Data.db'

My question is how do I create a new database in the current file directory?

bonus question: what do the two colons means?

1

There are 1 answers

0
Kimmo Lehto On BEST ANSWER

The file gets created if it doesn't exist.

Bonus: SQLite3::Database points to SQLite3 module's Database submodule or subclass.