@evolu/react-native 7.0.0 → 7.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/dist/SqliteLive.d.ts.map +1 -1
- package/dist/SqliteLive.js +2 -6
- package/package.json +2 -2
- package/src/SqliteLive.ts +2 -7
package/dist/SqliteLive.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SqliteLive.d.ts","sourceRoot":"","sources":["../src/SqliteLive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,MAAM,
|
|
1
|
+
{"version":3,"file":"SqliteLive.d.ts","sourceRoot":"","sources":["../src/SqliteLive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,MAAM,EAMP,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,eAAO,MAAM,UAAU,oCA6BtB,CAAC"}
|
package/dist/SqliteLive.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Config, Sqlite, ensureSqliteQuery, maybeParseJson, valuesToSqliteValues, } from "@evolu/common";
|
|
1
|
+
import { Config, Sqlite, ensureSqliteQuery, isSqlMutation, maybeParseJson, valuesToSqliteValues, } from "@evolu/common";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
4
|
import * as ExpoSQLite from "expo-sqlite/next.js";
|
|
@@ -12,11 +12,7 @@ export const SqliteLive = Layer.effect(Sqlite, Effect.gen(function* (_) {
|
|
|
12
12
|
sql: sqliteQuery.sql,
|
|
13
13
|
args: valuesToSqliteValues(sqliteQuery.parameters),
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
query.sql.trimStart().toLowerCase().startsWith("pragma");
|
|
17
|
-
// Expo can log only strings.
|
|
18
|
-
// console.log(JSON.stringify(isSelect), sql);
|
|
19
|
-
if (isSelectOrPragma) {
|
|
15
|
+
if (!isSqlMutation(query.sql)) {
|
|
20
16
|
const rows = (yield* _(Effect.promise(() => db.getAllAsync(query.sql, query.args))));
|
|
21
17
|
maybeParseJson(rows);
|
|
22
18
|
return { rows, changes: 0 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evolu/react-native",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"description": "Evolu for React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"evolu",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react-native": "0.73.4",
|
|
41
41
|
"typescript": "^5.3.3",
|
|
42
42
|
"vitest": "^1.3.1",
|
|
43
|
-
"@evolu/common": "4.0.
|
|
43
|
+
"@evolu/common": "4.0.1",
|
|
44
44
|
"@evolu/common-react": "6.0.0",
|
|
45
45
|
"@evolu/tsconfig": "0.0.2",
|
|
46
46
|
"eslint-config-evolu": "1.0.0"
|
package/src/SqliteLive.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
Sqlite,
|
|
4
4
|
SqliteRow,
|
|
5
5
|
ensureSqliteQuery,
|
|
6
|
+
isSqlMutation,
|
|
6
7
|
maybeParseJson,
|
|
7
8
|
valuesToSqliteValues,
|
|
8
9
|
} from "@evolu/common";
|
|
@@ -25,13 +26,7 @@ export const SqliteLive = Layer.effect(
|
|
|
25
26
|
args: valuesToSqliteValues(sqliteQuery.parameters),
|
|
26
27
|
};
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
query.sql.trimStart().toLowerCase().startsWith("select") ||
|
|
30
|
-
query.sql.trimStart().toLowerCase().startsWith("pragma");
|
|
31
|
-
// Expo can log only strings.
|
|
32
|
-
// console.log(JSON.stringify(isSelect), sql);
|
|
33
|
-
|
|
34
|
-
if (isSelectOrPragma) {
|
|
29
|
+
if (!isSqlMutation(query.sql)) {
|
|
35
30
|
const rows = (yield* _(
|
|
36
31
|
Effect.promise(() => db.getAllAsync(query.sql, query.args)),
|
|
37
32
|
)) as SqliteRow[];
|