Skip to content

Commit

Permalink
Use libsql instead of better-sqlite3
Browse files Browse the repository at this point in the history
  • Loading branch information
brendannee committed Sep 10, 2024
1 parent a84c827 commit 54e36a8
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 443 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ See [full list of options](https://csv.js.org/parse/options/).
{Database Instance} When passing configuration to `importGtfs` in javascript, you can pass a `db` parameter with an existing database instance. This is not possible using a json configuration file Optional.
```js
// Using better-sqlite3 to open database
// Using libsql to open database
import { importGtfs } from 'gtfs';
import Database from 'better-sqlite3';
import Database from 'libsql';

const db = new Database('/path/to/database');

Expand Down Expand Up @@ -630,7 +630,7 @@ There are also methods for retrieving stops and shapes in geoJSON format.
Most query methods accept three optional arguments: `query`, `fields`, `sortBy` and `options`.
For more advanced queries, you can use `advancedQuery` or raw SQL queries using query method from [better-sqlite3](#raw-sqlite-query).
For more advanced queries, you can use `advancedQuery` or raw SQL queries using query method from [libsql](https://github.com/tursodatabase/libsql-js).
### Database Setup
Expand Down Expand Up @@ -1759,7 +1759,7 @@ const stoptimes = advancedQuery('stop_times', advancedQueryOptions);
#### Raw SQLite Query
Use the `openDb` function to get the db object, and then use any query method from [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) to query GTFS data.
Use the `openDb` function to get the db object, and then use any query method from [libsql](https://github.com/tursodatabase/libsql-js) to query GTFS data.
```js
import { openDb } from 'gtfs';
Expand Down
Loading

0 comments on commit 54e36a8

Please sign in to comment.