mirror of
https://gitea.invidious.io/iv-org/shard-crystal-sqlite3.git
synced 2024-08-15 00:53:26 +00:00
Merge eea13c922c
into c58cea290c
This commit is contained in:
commit
0876a7b4f9
1 changed files with 8 additions and 0 deletions
|
@ -44,6 +44,14 @@ DB.open "sqlite3://./data.db" do |db|
|
|||
end
|
||||
```
|
||||
|
||||
Example 2
|
||||
```
|
||||
db = DB.open "sqlite3://./data.db"
|
||||
db.exec "CREATE TABLE IF NOT EXISTS contacts (name text, age integer)"
|
||||
db.exec "INSERT INTO contacts VALUES (?, ?)", "John Doe", 30
|
||||
contacts = db.query_all "SELECT name, age FROM contacts", as: {name: String, age: Int64}
|
||||
```
|
||||
|
||||
### DB::Any
|
||||
|
||||
* `Time` is implemented as `TEXT` column using `SQLite3::DATE_FORMAT_SUBSECOND` format (or `SQLite3::DATE_FORMAT_SECOND` if the text does not contain a dot).
|
||||
|
|
Loading…
Reference in a new issue