Skip to content

Commit 95c2182

Browse files
committed
fixing sourcemaps and import bugs
closes #54
1 parent 89654d3 commit 95c2182

File tree

8 files changed

+22
-33
lines changed

8 files changed

+22
-33
lines changed

Cargo.lock

Lines changed: 3 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,24 @@ By default SQLSync runs in a shared web worker. This allows the database to auto
4444

4545
The easiest way is to use Google Chrome, and go to the special URL: [chrome://inspect/#workers](chrome://inspect/#workers). On that page you'll find a list of all the running shared workers in other tabs. Assuming another tab is running SQLSync, you'll see the shared worker listed. Click `inspect` to open up dev-tools for the worker.
4646

47+
### My table is missing, or multiple statements aren't executing
48+
SQLSync uses [rusqlite] under the hood to run and query SQLite. Unfortunately, the `execute` method only supports single statements and silently ignores trailing statements. Thus, if you are using `execute!(...)` in your reducer, make sure that each call only runs a single SQL statement.
49+
50+
For example:
51+
```rust
52+
// DON'T DO THIS:
53+
execute!("create table foo (id int); create table bar (id int);").await?;
54+
55+
// DO THIS:
56+
execute!("create table foo (id int)").await?;
57+
execute!("create table bar (id int)").await?;
58+
```
59+
4760
## Community & Contributing
4861

4962
If you are interested in contributing to SQLSync, please [join the Discord community][discord] and let us know what you want to build. All contributions will be held to a high standard, and are more likely to be accepted if they are tied to an existing task and agreed upon specification.
5063

5164
[![Join the SQLSync Community](https://discordapp.com/api/guilds/1149205110262595634/widget.png?style=banner2)][discord]
5265

5366
[discord]: https://discord.gg/etFk2N9nzC
67+
[rusqlite]: https://github.com/rusqlite/rusqlite
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

examples/guestbook-react/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"lib": ["ES2020", "ES2021.WeakRef", "DOM", "DOM.Iterable"],
66
"module": "ESNext",
77
"skipLibCheck": true,
8-
"types": ["vite/client"],
98

109
/* Bundler mode */
1110
"moduleResolution": "bundler",

examples/reducer-guestbook/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ version.workspace = true
1111
crate-type = ["cdylib"]
1212

1313
[dependencies]
14-
sqlsync-reducer = "0.2"
14+
sqlsync-reducer = { path = "../../lib/sqlsync-reducer" }
1515
serde = { version = "1.0", features = ["derive"] }
1616
serde_json = "1.0"
1717
log = "0.4"

lib/sqlsync-react/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@
2424
"main": "./src/index.ts",
2525
"types": "./src/index.ts",
2626
"exports": {
27-
".": {
28-
"import": "./src/index.ts",
29-
"default": "./src/index.ts",
30-
"types": "./src/index.ts"
31-
}
27+
".": "./src/index.ts"
3228
},
3329
"publishConfig": {
3430
"main": "./dist/index.js",

lib/sqlsync-solid-js/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@
2525
"main": "./src/index.ts",
2626
"types": "./src/index.ts",
2727
"exports": {
28-
".": {
29-
"import": "./src/index.ts",
30-
"default": "./src/index.ts",
31-
"types": "./src/index.ts"
32-
}
28+
".": "./src/index.ts"
3329
},
3430
"publishConfig": {
3531
"main": "./dist/index.js",

lib/sqlsync-worker/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@
2626
],
2727
"main": "./src/index.ts",
2828
"exports": {
29-
".": {
30-
"default": "./src/index.ts",
31-
"import": "./src/index.ts",
32-
"types": "./src/index.ts"
33-
},
29+
".": "./src/index.ts",
3430
"./worker.ts": "./src/worker.ts",
3531
"./sqlsync.wasm": "./sqlsync-wasm/pkg/sqlsync_wasm_bg.wasm"
3632
},

0 commit comments

Comments
 (0)