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

update cr-sqlite to latest #38

Merged
merged 8 commits into from
Nov 27, 2023
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
6 changes: 3 additions & 3 deletions .github/workflows/js-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ jobs:
if: runner.os == 'Linux'
run: sudo apt-get update; sudo apt install -y wabt

- name: Install wabt (osx)
- name: Install wabt and gmake (osx)
if: runner.os == 'macOS'
run: brew install wabt
run: brew install wabt; brew install make; printf '%s\n%s\n' "/usr/local/opt/make/libexec/gnubin" "$(cat $GITHUB_PATH)" > $GITHUB_PATH

- name: Install wasm-pack
run: cargo install wasm-pack

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 19.x
node-version: 20.x

- name: Install pnpm
run: npm install -g pnpm
Expand Down
2 changes: 1 addition & 1 deletion deps/cr-sqlite
Submodule cr-sqlite updated 133 files
2 changes: 1 addition & 1 deletion deps/wa-sqlite
Submodule wa-sqlite updated 1 files
+8 −6 Makefile
2 changes: 1 addition & 1 deletion packages/direct-connect-nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@vlcn.io/crsqlite": "workspace:*",
"@vlcn.io/direct-connect-common": "workspace:*",
"@vlcn.io/xplat-api": "workspace:*",
"better-sqlite3": "^8.3.0",
"better-sqlite3": "^9.1.1",
"chokidar": "^3.5.3",
"throttle-debounce": "^5.0.0",
"winston": "^3.10.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/node-allinone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@vlcn.io/crsqlite": "workspace:*",
"@vlcn.io/xplat-api": "workspace:*",
"better-sqlite3": "^8.3.0"
"better-sqlite3": "^9.1.1"
},
"scripts": {
"build": "tsc --build",
Expand Down
2 changes: 1 addition & 1 deletion packages/node-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@vlcn.io/rx-tbl": "workspace:*",
"@vlcn.io/xplat-api": "workspace:*",
"@vlcn.io/xplat-tests": "workspace:*",
"better-sqlite3": "^8.3.0",
"better-sqlite3": "^9.1.1",
"fast-check": "^3.8.0",
"nanoid": "^4.0.2"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/node-tests/src/__tests__/automigrate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import crsqlite from "@vlcn.io/crsqlite-allinone";
test("automigrate", () => {
const db = crsqlite.open();
const schema = /*sql*/ `
CREATE TABLE IF NOT EXISTS test (id PRIMARY KEY, name TEXT);
CREATE TABLE IF NOT EXISTS test (id PRIMARY KEY NOT NULL, name TEXT);
SELECT crsql_as_crr('test');
`;
db.exec(`SELECT crsql_automigrate(?);`, [schema]);
Expand All @@ -15,7 +15,7 @@ test("automigrate", () => {
db.exec(`SELECT crsql_automigrate(?);`, [updatedSchema]);

const db2 = crsqlite.open();
const schema2 = `CREATE TABLE IF NOT EXISTS test (id PRIMARY KEY, name TEXT);
const schema2 = `CREATE TABLE IF NOT EXISTS test (id PRIMARY KEY NOT NULL, name TEXT);
SELECT crsql_as_crr('test');
`;
db2.exec(`SELECT crsql_automigrate(?);`, [schema]);
Expand Down
4 changes: 3 additions & 1 deletion packages/node-tests/src/__tests__/fract-check.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import fc from "fast-check";
function setupDb() {
const db = crsqlite.open();

db.exec(`CREATE TABLE todo (id primary key, list_id, ordering, content)`);
db.exec(
`CREATE TABLE todo (id primary key not null, list_id, ordering, content)`
);
db.exec(`SELECT crsql_as_crr('todo')`);
db.exec(`SELECT crsql_fract_as_ordered('todo', 'ordering', 'list_id')`);

Expand Down
5 changes: 3 additions & 2 deletions packages/node-tests/src/__tests__/user-reports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ test("failed to increment?", () => {
INSERT INTO a VALUES (10, 123);
UPDATE b SET data = 10 WHERE data IS ${initial};
`);
const siteId = database.prepare(`SELECT crsql_site_id()`).pluck().get();
expect(database.prepare(`SELECT * FROM crsql_changes`).all()).toEqual([
{
table: "a",
Expand All @@ -58,7 +59,7 @@ test("failed to increment?", () => {
val: 123,
col_version: 1,
db_version: 2,
site_id: null,
site_id: siteId,
cl: 1,
seq: 0,
},
Expand All @@ -69,7 +70,7 @@ test("failed to increment?", () => {
val: 10,
col_version: 2,
db_version: 3,
site_id: null,
site_id: siteId,
cl: 1,
seq: 0,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sandbox-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"deep-clean": "rm -rf ./dist || true && rm tsconfig.tsbuildinfo || true"
},
"dependencies": {
"better-sqlite3": "^8.3.0"
"better-sqlite3": "^9.1.1"
},
"devDependencies": {
"@vlcn.io/crsqlite": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/ws-litefs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@vlcn.io/crsqlite": "workspace:*",
"@vlcn.io/ws-common": "workspace:*",
"@vlcn.io/ws-server": "workspace:*",
"better-sqlite3": "^8.3.0",
"better-sqlite3": "^9.1.1",
"chokidar": "^3.5.3",
"throttle-debounce": "^5.0.0",
"winston": "^3.10.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/ws-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@vlcn.io/crsqlite": "workspace:*",
"@vlcn.io/ws-common": "workspace:*",
"@vlcn.io/logger-provider": "workspace:*",
"better-sqlite3": "^8.3.0",
"better-sqlite3": "^9.1.1",
"chokidar": "^3.5.3",
"throttle-debounce": "^5.0.0",
"winston": "^3.10.0",
Expand Down
52 changes: 26 additions & 26 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.