-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use jsr:@db/sqlite in runtime/tutorials/connecting_to_databases.md (#…
- Loading branch information
Showing
1 changed file
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,14 +113,17 @@ There are two primary solutions to connect to SQLite in Deno: | |
|
||
### Connect to SQLite with the FFI Module | ||
|
||
[sqlite3](https://deno.land/x/sqlite3) provides JavaScript bindings to the | ||
[@db/sqlite](https://jsr.io/@db/sqlite) provides JavaScript bindings to the | ||
SQLite3 C API, using [Deno FFI](../reference/deno_namespace_apis.md#ffi). | ||
|
||
```ts | ||
import { Database } from "https://deno.land/x/sqlite3@LATEST_VERSION/mod.ts"; | ||
import { Database } from "jsr:@db/[email protected]"; | ||
|
||
const db = new Database("test.db"); | ||
|
||
const [version] = db.prepare("select sqlite_version()").value<[string]>()!; | ||
console.log(version); | ||
|
||
db.close(); | ||
``` | ||
|
||
|