Open starkgate opened 6 years ago
DB.open without a block will give you a Database instance .
Even with block syntax you are allowed to have multiple Database instances.
I see, I wasn't aware of that (new to Crystal). I'll try it out, thank you.
With the new example, i assume this issue can be closed?
Inspired from the Ruby sqlite gem, here is an improvement I would like to see in the Crystal shard syntax : Being able to create a new database object, allowing usage everywhere in the code, as opposed to only in the 'do' block. Also would allow for usage of several databases at once. db = SQLite3::Database.new 'database.db'
You would then be able to run db.exec, db.query on this object.