Skip to content

Commit b8c2586

Browse files
authored
Merge pull request #24 from expo-starter/chore/upgrade-sqljs
upgrading sqljs
2 parents 0dcd073 + 84ef638 commit b8c2586

File tree

9 files changed

+20
-6
lines changed

9 files changed

+20
-6
lines changed

app/(tabs)/index.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ function ScreenContent() {
7676
</Text>
7777
<Text className="text-sm">
7878
If you change the schema, you need to run{" "}
79+
<Text className="text-sm font-mono text-muted-foreground bg-muted">
80+
bun db:generate
81+
</Text>
82+
<Text className="text-sm px-1">
83+
then
84+
</Text>
7985
<Text className="text-sm font-mono text-muted-foreground bg-muted">
8086
bun migrate
8187
</Text>

app/habits/archive.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export default function Home() {
4242
})
4343
.where(eq(habitTable.id, habitId))
4444
.execute();
45-
console.log("restore")
4645
} catch (error) {
4746
console.error("error", error);
4847
}
@@ -56,7 +55,6 @@ export default function Home() {
5655
{
5756
text: 'Continue',
5857
onPress: () => {
59-
console.log("pressed")
6058
// try {
6159
// await db?.delete(habitTable).where(eq(habitTable.id, habitId)).execute();
6260
// } catch (error) {

bun.lockb

0 Bytes
Binary file not shown.

db/drizzle.web.ts

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useDatabase } from "./provider";
44
import { useEffect, useReducer } from "react";
55

66
export const initialize = async (): Promise<SQLJsDatabase> => {
7-
console.log("initialze web");
87
const sqlPromise = initSqlJs({
98
locateFile: (file) => `https://sql.js.org/dist/${file}`,
109
});

db/migrations/meta/_journal.json

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
"when": 1719918496003,
1616
"tag": "0001_absurd_blonde_phantom",
1717
"breakpoints": true
18+
},
19+
{
20+
"idx": 2,
21+
"version": "6",
22+
"when": 1726505292364,
23+
"tag": "0002_short_dagger",
24+
"breakpoints": true
1825
}
1926
]
2027
}

db/migrations/migrations.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
import journal from './meta/_journal.json';
44
import m0000 from './0000_cultured_lizard.sql';
55
import m0001 from './0001_absurd_blonde_phantom.sql';
6+
import m0002 from './0002_short_dagger.sql';
67

78
export default {
89
journal,
910
migrations: {
1011
m0000,
11-
m0001
12+
m0001,
13+
m0002
1214
}
1315
}
1416

drizzle.config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export default {
44
out: './db/migrations',
55
driver: 'expo',
66
dialect: 'sqlite',
7-
} satisfies Config;
7+
8+
}satisfies Config;

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"web": "expo start -c --web",
1515
"export": "expo export -p web",
1616
"format": "biome check --no-errors-on-unmatched --apply .",
17+
"db:generate": "bun drizzle-kit generate",
1718
"migrate": "bun ./db/migrate.ts",
1819
"db:studio": "bun drizzle-kit studio"
1920
},
@@ -68,7 +69,7 @@
6869
"react-native-screens": "3.31.1",
6970
"react-native-svg": "15.3.0",
7071
"react-native-web": "~0.19.6",
71-
"sql.js": "^1.10.3",
72+
"sql.js": "^1.11.0",
7273
"tailwind-merge": "^2.2.1",
7374
"tailwindcss-animate": "^1.0.7",
7475
"zod": "^3.23.6",

public/database.sqlite

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)