@sqb/sqljs 5.0.7 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,30 +6,23 @@
6
6
 
7
7
  [![NPM Version][npm-image]][npm-url]
8
8
  [![NPM Downloads][downloads-image]][downloads-url]
9
- [![Build Status][travis-image]][travis-url]
9
+ [![CI Tests][ci-test-image]][ci-test-url]
10
10
  [![Test Coverage][coveralls-image]][coveralls-url]
11
- [![Dependencies][dependencies-image]][dependencies-url]
12
- [![DevDependencies][devdependencies-image]][devdependencies-url]
13
- [![Package Quality][quality-image]][quality-url]
14
11
 
15
12
  ## About SQB
16
13
 
17
14
  SQB is an extensible, multi-dialect SQL query builder and Database connection wrapper for NodeJS.
18
15
 
19
- ## Main goals
16
+ ## About @sqb/sqljs
20
17
 
21
- - Single code base for any sql based database
22
- - Powerful and simplified query coding scheme
23
- - Fast applications with low memory requirements
24
- - Let applications work with large data tables efficiently
25
- - Support latest JavaScript language standards
26
- - Lightweight and extensible framework.
18
+ This package is a SQB `Adapter` for SQLite backed by [`sql.js`](https://github.com/sql-js/sql.js),
19
+ a WebAssembly build of SQLite. Unlike [`@sqb/sqlite`](../sqlite), it needs no native bindings or a
20
+ runtime-provided SQLite module, so it runs anywhere WebAssembly does — including the browser.
27
21
 
28
- You can report bugs and discuss features on the [GitHub issues](https://github.com/sqbjs/sqb/issues) page
29
-
30
- Thanks to all of the great [contributions](https://github.com/sqbjs/sqb/graphs/contributors) to the project.
31
-
32
- You may want to check detailed [DOCUMENTATION](https://sqbjs.github.io/sqb/)
22
+ Pass a file path as `database` to load (and keep in sync with) an on-disk `.sqlite` file, or
23
+ `:memory:` (optionally suffixed, e.g. `:memory:test1`) for a purely in-memory database. Databases
24
+ opened with the same name are reference-counted and shared across connections rather than reopened.
25
+ It shares its SQL serialization rules with `@sqb/sqlite` via [`@sqb/sqlite-dialect`](../sqlite-dialect).
33
26
 
34
27
  ## Installation
35
28
 
@@ -37,9 +30,21 @@ You may want to check detailed [DOCUMENTATION](https://sqbjs.github.io/sqb/)
37
30
  $ npm install @sqb/sqljs --save
38
31
  ```
39
32
 
33
+ ## Usage
34
+
35
+ ```ts
36
+ import '@sqb/sqljs';
37
+ import { SqbClient } from '@sqb/connect';
38
+
39
+ const client = new SqbClient({
40
+ driver: 'sqljs',
41
+ database: '/path/to/database.sqlite', // or ':memory:'
42
+ });
43
+ ```
44
+
40
45
  ## Node Compatibility
41
46
 
42
- - node >= 16.x
47
+ - node >= 20.x
43
48
 
44
49
  ### License
45
50
 
@@ -47,17 +52,9 @@ SQB is available under [MIT](LICENSE) license.
47
52
 
48
53
  [npm-image]: https://img.shields.io/npm/v/@sqb/sqljs.svg
49
54
  [npm-url]: https://npmjs.org/package/@sqb/sqljs
50
- [travis-image]: https://img.shields.io/travis/sqbjs/@sqb/sqljs/master.svg
51
- [travis-url]: https://travis-ci.org/sqbjs/@sqb/sqljs
52
- [coveralls-image]: https://img.shields.io/coveralls/sqbjs/@sqb/sqljs/master.svg
53
- [coveralls-url]: https://coveralls.io/r/sqbjs/@sqb/sqljs
54
55
  [downloads-image]: https://img.shields.io/npm/dm/@sqb/sqljs.svg
55
56
  [downloads-url]: https://npmjs.org/package/@sqb/sqljs
56
- [gitter-image]: https://badges.gitter.im/sqbjs/@sqb/sqljs.svg
57
- [gitter-url]: https://gitter.im/sqbjs/@sqb/sqljs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
58
- [dependencies-image]: https://david-dm.org/sqbjs/@sqb/sqljs/status.svg
59
- [dependencies-url]: https://david-dm.org/sqbjs/@sqb/sqljs
60
- [devdependencies-image]: https://david-dm.org/sqbjs/@sqb/sqljs/dev-status.svg
61
- [devdependencies-url]: https://david-dm.org/sqbjs/@sqb/sqljs?type=dev
62
- [quality-image]: http://npm.packagequality.com/shield/@sqb/sqljs.png
63
- [quality-url]: http://packagequality.com/#?package=@sqb/sqljs
57
+ [ci-test-image]: https://github.com/panates/sqb/actions/workflows/test.yml/badge.svg
58
+ [ci-test-url]: https://github.com/panates/sqb/actions/workflows/test.yml
59
+ [coveralls-image]: https://coveralls.io/repos/github/sqbjs/sqb/badge.svg?branch=master
60
+ [coveralls-url]: https://coveralls.io/github/sqbjs/sqb?branch=master
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sqb/sqljs",
3
3
  "description": "SQB serialization extension for sql.js driver",
4
- "version": "5.0.7",
4
+ "version": "6.0.1",
5
5
  "author": "Panates",
6
6
  "license": "Apache-2.0",
7
7
  "dependencies": {
@@ -9,9 +9,9 @@
9
9
  "tslib": "^2.8.1"
10
10
  },
11
11
  "peerDependencies": {
12
- "@sqb/builder": "^5.0.7",
13
- "@sqb/connect": "^5.0.7",
14
- "@sqb/sqlite-dialect": "^5.0.7",
12
+ "@sqb/builder": "^6.0.1",
13
+ "@sqb/connect": "^6.0.1",
14
+ "@sqb/sqlite-dialect": "^6.0.1",
15
15
  "sql.js": "^1.14.2"
16
16
  },
17
17
  "type": "module",
@@ -3,9 +3,7 @@ import type { Adapter, ClientConfiguration } from '@sqb/connect';
3
3
  export declare class SqljsAdapter implements Adapter {
4
4
  driver: string;
5
5
  dialect: string;
6
- features: {
7
- cursor: boolean;
8
- };
6
+ features: Adapter.Features;
9
7
  connect(config: ClientConfiguration): Promise<Adapter.Connection>;
10
8
  }
11
9
  export declare function closeMemoryDatabase(name?: string): Promise<void>;