Skip to content

Commit beec888

Browse files
committed
Update README.md
1 parent ea9a6c6 commit beec888

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ jobs:
356356
body: |
357357
# Packages
358358
359-
[**Flutter/Dart**](https://pub.dev/packages/sqlite_js): `dart pub add sqlite_js`
359+
[**Flutter/Dart**](https://pub.dev/packages/sqlite_js): `flutter pub add sqlite_js:${{ steps.tag.outputs.version }}` or `dart pub add sqlite_js:${{ steps.tag.outputs.version }}`
360360
[**Node**](https://www.npmjs.com/package/@sqliteai/sqlite-js): `npm install @sqliteai/sqlite-js`
361361
[**Android**](https://central.sonatype.com/artifact/ai.sqlite/js): `ai.sqlite:js:${{ steps.tag.outputs.version }}`
362362
[**Swift**](https://github.com/sqliteai/sqlite-js#swift-package): [Installation Guide](https://github.com/sqliteai/sqlite-js#swift-package)

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,27 @@ SQLiteDatabase db = SQLiteDatabase.openDatabase(config, null, null);
8686

8787
**Note:** Additional settings and configuration are required for a complete setup. For full implementation details, see the [complete Android example](https://github.com/sqliteai/sqlite-extensions-guide/blob/main/examples/android/README.md).
8888

89+
### Flutter Package
90+
91+
Add the [sqlite_js](https://pub.dev/packages/sqlite_js) package to your project:
92+
93+
```bash
94+
flutter pub add sqlite_js # Flutter projects
95+
dart pub add sqlite_js # Dart projects
96+
```
97+
98+
Usage with `sqlite3` package:
99+
```dart
100+
import 'package:sqlite3/sqlite3.dart';
101+
import 'package:sqlite_js/sqlite_js.dart';
102+
103+
sqlite3.loadSqliteJsExtension();
104+
final db = sqlite3.openInMemory();
105+
print(db.select('SELECT js_version()'));
106+
```
107+
108+
For a complete example, see the [Flutter example](https://github.com/sqliteai/sqlite-extensions-guide/blob/main/examples/flutter/README.md).
109+
89110
## Functions Overview
90111

91112
SQLite-JS provides several ways to extend SQLite functionality with JavaScript:

0 commit comments

Comments
 (0)