Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename package to use @powersync #9

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/odd-timers-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@powersync/wa-sqlite": patch
---

Rename package to @powersync/wa-sqlite
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# @journeyapps/wa-sqlite
# @powersync/wa-sqlite

## For the following previous versions refer to `@journeyapps/wa-sqlite`

## 0.2.0

Expand Down
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![wa-sqlite CI](https://github.com/rhashimoto/wa-sqlite/actions/workflows/ci.yml/badge.svg?branch=breaking-changes)](https://github.com/rhashimoto/wa-sqlite/actions/workflows/ci.yml?branch=breaking-changes)
[![wa-sqlite CI](https://github.com/powersync-ja/wa-sqlite/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/powersync-ja/wa-sqlite/actions/workflows/ci.yml?branch=master)

# Beta
This package is currently in a beta release.
Expand All @@ -7,13 +7,13 @@ This package is currently in a beta release.
# wa-sqlite
This is a WebAssembly build of SQLite with experimental support for writing SQLite virtual filesystems and virtual table modules completely in Javascript. This allows alternative browser storage options such as IndexedDB and File System Access. Applications can opt to use either a synchronous or asynchronous (using Asyncify) SQLite library build (an asynchronous build is required for asynchronous extensions).

[IndexedDB](https://github.com/rhashimoto/wa-sqlite/blob/master/src/examples/IDBMinimalVFS.js) and [Origin Private File System](https://github.com/rhashimoto/wa-sqlite/blob/master/src/examples/OriginPrivateFileSystemVFS.js) virtual file systems and a [virtual table module that accesses Javascript arrays](https://github.com/rhashimoto/wa-sqlite/blob/master/src/examples/ArrayModule.js) are among the examples provided as proof of concept.
[IndexedDB](https://github.com/powersync-ja/wa-sqlite/blob/master/src/examples/IDBMinimalVFS.js) and [Origin Private File System](https://github.com/powersync-ja/wa-sqlite/blob/master/src/examples/OriginPrivateFileSystemVFS.js) virtual file systems and a [virtual table module that accesses Javascript arrays](https://github.com/powersync-ja/wa-sqlite/blob/master/src/examples/ArrayModule.js) are among the examples provided as proof of concept.

[Try the demo](https://rhashimoto.github.io/wa-sqlite/demo/) or run [benchmarks](https://rhashimoto.github.io/wa-sqlite/demo/benchmarks.html) with a modern desktop web browser. More information is available in the [FAQ](https://github.com/rhashimoto/wa-sqlite/issues?q=is%3Aissue+label%3Afaq+), [discussion forums](https://github.com/rhashimoto/wa-sqlite/discussions), and [API reference](https://rhashimoto.github.io/wa-sqlite/docs/).

## Build
The primary motivation for this project is to enable additions to SQLite with only Javascript. Most developers should be able to use the pre-built artifacts in
[./dist](https://github.com/rhashimoto/wa-sqlite/tree/master/dist).
[./dist](https://github.com/powersync-ja/wa-sqlite/tree/master/dist).
Note that earlier versions of the project only provided pre-built artifacts in the
"buildless" branch; that branch will no longer be maintained.

Expand All @@ -33,9 +33,9 @@ Here are the build steps:

The default build produces ES6 modules + WASM, [synchronous and asynchronous](https://github.com/rhashimoto/wa-sqlite/issues/7) (using Asyncify) in `dist/`.

## JouneyApps instructions
## PowerSync instructions

Note as per above that this is known to compile under Debian.
Note as per above that this is known to compile under Debian.

MacOS initially complained about OpenSSL config. Compiling on MacOS may be possible with additional config, but this is currently unknown.

Expand All @@ -45,7 +45,6 @@ Development has been done using VSCode's [development container](https://code.vi
git clone [this repo]
```


```bash
git submodule init
```
Expand All @@ -56,15 +55,12 @@ git submodule update --init --recursive

```bash
yarn install

```


```bash
```bash
make -B
```


## API
Javascript wrappers for core SQLITE C API functions (and some others) are provided. Some convenience functions are also provided to reduce boilerplate. Here's sample code to load the library and call the API:

Expand Down Expand Up @@ -110,4 +106,4 @@ For convenience, if any text region is selected in the editor, only that region
## License
MIT License as of February 10, 2023, changed by generous sponsors
[Fleet Device Management](https://fleetdm.com/) and [Reflect](https://reflect.app/).
Existing licensees may continue under the GPLv3 or switch to the new license.
Existing licensees may continue under the GPLv3 or switch to the new license.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@journeyapps/wa-sqlite",
"name": "@powersync/wa-sqlite",
"version": "0.2.0",
"publishConfig": {
"access": "public"
Expand Down
40 changes: 20 additions & 20 deletions src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ declare interface SQLiteAPI {

/**
* Registers table row on change callback
*
*
*/
register_table_onchange_hook(db: number, callback: (opType: number, tableName: string, rowId: number) => void): void;

Expand Down Expand Up @@ -1023,7 +1023,7 @@ declare interface SQLiteAPI {
}

/** @ignore */
declare module '@journeyapps/wa-sqlite/src/sqlite-constants.js' {
declare module '@powersync/wa-sqlite/src/sqlite-constants.js' {
export const SQLITE_OK: 0;
export const SQLITE_ERROR: 1;
export const SQLITE_INTERNAL: 2;
Expand Down Expand Up @@ -1256,8 +1256,8 @@ declare module '@journeyapps/wa-sqlite/src/sqlite-constants.js' {
}

/** @ignore */
declare module '@journeyapps/wa-sqlite' {
export * from '@journeyapps/wa-sqlite/src/sqlite-constants.js';
declare module '@powersync/wa-sqlite' {
export * from '@powersync/wa-sqlite/src/sqlite-constants.js';

/**
* Builds a Javascript API from the Emscripten module. This API is still
Expand All @@ -1275,20 +1275,20 @@ declare module '@journeyapps/wa-sqlite' {
}

/** @ignore */
declare module '@journeyapps/wa-sqlite/dist/wa-sqlite.mjs' {
declare module '@powersync/wa-sqlite/dist/wa-sqlite.mjs' {
function ModuleFactory(config?: object): Promise<any>;
export = ModuleFactory;
}

/** @ignore */
declare module '@journeyapps/wa-sqlite/dist/wa-sqlite-async.mjs' {
declare module '@powersync/wa-sqlite/dist/wa-sqlite-async.mjs' {
function ModuleFactory(config?: object): Promise<any>;
export = ModuleFactory;
}

/** @ignore */
declare module '@journeyapps/wa-sqlite/src/VFS.js' {
export * from '@journeyapps/wa-sqlite/src/sqlite-constants.js';
declare module '@powersync/wa-sqlite/src/VFS.js' {
export * from '@powersync/wa-sqlite/src/sqlite-constants.js';

export class Base {
mxPathName: number;
Expand Down Expand Up @@ -1533,7 +1533,7 @@ declare module 'wa-sqlite/src/examples/ArrayModule.js' {
}

/** @ignore */
declare module '@journeyapps/wa-sqlite/src/examples/ArrayAsyncModule.js' {
declare module '@powersync/wa-sqlite/src/examples/ArrayAsyncModule.js' {
import { ArrayModule } from 'wa-sqlite/src/examples/ArrayModule.js';
export class ArrayAsyncModule extends ArrayModule {
/**
Expand All @@ -1545,8 +1545,8 @@ declare module '@journeyapps/wa-sqlite/src/examples/ArrayAsyncModule.js' {
}

/** @ignore */
declare module '@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js' {
import * as VFS from '@journeyapps/wa-sqlite/src/VFS.js';
declare module '@powersync/wa-sqlite/src/examples/AccessHandlePoolVFS.js' {
import * as VFS from '@powersync/wa-sqlite/src/VFS.js';
export class AccessHandlePoolVFS extends VFS.Base {
/**
* @param {string} directoryPath Flat directory where all OPFS files are stored
Expand All @@ -1556,8 +1556,8 @@ declare module '@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js' {
}

/** @ignore */
declare module '@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js' {
import * as VFS from '@journeyapps/wa-sqlite/src/VFS.js';
declare module '@powersync/wa-sqlite/src/examples/IDBBatchAtomicVFS.js' {
import * as VFS from '@powersync/wa-sqlite/src/VFS.js';
export class IDBBatchAtomicVFS extends VFS.Base {
/**
* @param {string} idbDatabaseName IndexDB DB name
Expand All @@ -1574,22 +1574,22 @@ declare module '@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js' {

/** @ignore */
declare module '@journeyapp/wa-sqlite/src/examples/IDBVersionedVFS.js' {
import {IDBBatchAtomicVFS} from '@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js';
import {IDBBatchAtomicVFS} from '@powersync/wa-sqlite/src/examples/IDBBatchAtomicVFS.js';
export class IDBVersionedVFS extends IDBBatchAtomicVFS {}
}


/** @ignore */
declare module '@journeyapp/wa-sqlite/src/examples/OriginPrivatefileSystemVFS.js' {
import * as VFS from '@journeyapps/wa-sqlite/src/VFS.js';
import * as VFS from '@powersync/wa-sqlite/src/VFS.js';
export class OriginPrivateFileSystemVFS extends VFS.Base {
close(): Promise<void>;
}
}

/** @ignore */
declare module 'wa-sqlite/src/examples/IDBMinimalVFS.js' {
import * as VFS from '@journeyapps/wa-sqlite/src/VFS.js';
import * as VFS from '@powersync/wa-sqlite/src/VFS.js';
export class IDBMinimalVFS extends VFS.Base {
/**
* @param {string} idbDatabaseName IndexDB DB name
Expand All @@ -1603,8 +1603,8 @@ declare module 'wa-sqlite/src/examples/IDBMinimalVFS.js' {
}

/** @ignore */
declare module '@journeyapps/wa-sqlite/src/examples/IndexedDbVFS.js' {
import * as VFS from '@journeyapps/wa-sqlite/src/VFS.js';
declare module '@powersync/wa-sqlite/src/examples/IndexedDbVFS.js' {
import * as VFS from '@powersync/wa-sqlite/src/VFS.js';
export class IndexedDbVFS extends VFS.Base {
/**
* @param {string} idbName Name of IndexedDB database.
Expand Down Expand Up @@ -1657,7 +1657,7 @@ declare module '@journeyapps/wa-sqlite/src/examples/IndexedDbVFS.js' {

/** @ignore */
declare module 'wa-sqlite/src/examples/MemoryVFS.js' {
import * as VFS from '@journeyapps/wa-sqlite/src/VFS.js';
import * as VFS from '@powersync/wa-sqlite/src/VFS.js';
export class MemoryVFS extends VFS.Base {
name: string;
mapNameToFile: Map<any, any>;
Expand Down Expand Up @@ -1692,4 +1692,4 @@ declare module 'wa-sqlite/src/examples/tag.js' {
* @returns {function(TemplateStringsArray, ...any): Promise<object[]>}
*/
export function tag(sqlite3: any, db: number): (arg0: TemplateStringsArray, ...args: any[]) => Promise<object[]>;
}
}
52 changes: 26 additions & 26 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -309,32 +309,6 @@ __metadata:
languageName: node
linkType: hard

"@journeyapps/wa-sqlite@workspace:.":
version: 0.0.0-use.local
resolution: "@journeyapps/wa-sqlite@workspace:."
dependencies:
"@changesets/cli": ^2.26.2
"@web/dev-server": ^0.1.13
comlink: ^4.4.1
jasmine-core: ^4.5.0
karma: ^6.4.1
karma-chrome-launcher: ^3.1.1
karma-jasmine: ^5.1.0
monaco-editor: ^0.34.1
puppeteer: ^19.6.3
sinon: 15.0.1
typedoc: ^0.22.11
typescript: ^4.2.4
dependenciesMeta:
[email protected]:
unplugged: true
[email protected]:
unplugged: true
[email protected]:
unplugged: true
languageName: unknown
linkType: soft

"@manypkg/find-root@npm:^1.1.0":
version: 1.1.0
resolution: "@manypkg/find-root@npm:1.1.0"
Expand Down Expand Up @@ -417,6 +391,32 @@ __metadata:
languageName: node
linkType: hard

"@powersync/wa-sqlite@workspace:.":
version: 0.0.0-use.local
resolution: "@powersync/wa-sqlite@workspace:."
dependencies:
"@changesets/cli": ^2.26.2
"@web/dev-server": ^0.1.13
comlink: ^4.4.1
jasmine-core: ^4.5.0
karma: ^6.4.1
karma-chrome-launcher: ^3.1.1
karma-jasmine: ^5.1.0
monaco-editor: ^0.34.1
puppeteer: ^19.6.3
sinon: 15.0.1
typedoc: ^0.22.11
typescript: ^4.2.4
dependenciesMeta:
[email protected]:
unplugged: true
[email protected]:
unplugged: true
[email protected]:
unplugged: true
languageName: unknown
linkType: soft

"@puppeteer/browsers@npm:0.5.0":
version: 0.5.0
resolution: "@puppeteer/browsers@npm:0.5.0"
Expand Down
Loading