Skip to content

Commit e31dc35

Browse files
committed
Add opSqlite and drizzle
1 parent 56b3067 commit e31dc35

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

bun.lockb

20.7 KB
Binary file not shown.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"prettier:fix": "prettier --write ."
2020
},
2121
"dependencies": {
22+
"@op-engineering/op-sqlite": "^11.2.13",
2223
"@react-native-clipboard/clipboard": "^1.15.0",
2324
"@react-native-community/netinfo": "^11.4.1",
2425
"@react-native-masked-view/masked-view": "^0.3.2",
@@ -28,6 +29,7 @@
2829
"@shopify/react-native-skia": "^1.5.8",
2930
"@tanstack/react-query": "^5.62.12",
3031
"clsx": "^2.1.1",
32+
"drizzle-orm": "^0.38.3",
3133
"hono": "^4.6.11",
3234
"lottie-react-native": "^7.1.0",
3335
"nativewind": "^4.1.23",
@@ -41,14 +43,12 @@
4143
"react-native-reanimated": "3.16.3",
4244
"react-native-safe-area-context": "^5.0.0",
4345
"react-native-screens": "^4.4.0",
44-
"react-native-sqlite-storage": "^6.0.1",
4546
"react-native-svg": "^15.9.0",
4647
"tailwind-merge": "^2.6.0",
4748
"zod": "^3.24.1",
4849
"zustand": "^5.0.2"
4950
},
5051
"devDependencies": {
51-
"tailwindcss": "^3.4.16",
5252
"@babel/core": "^7.25.2",
5353
"@babel/preset-env": "^7.25.3",
5454
"@babel/runtime": "^7.25.0",
@@ -63,13 +63,14 @@
6363
"@types/react-test-renderer": "^18.0.0",
6464
"babel-jest": "^29.6.3",
6565
"babel-plugin-module-resolver": "^5.0.2",
66+
"drizzle-kit": "^0.30.1",
6667
"eslint": "^8.19.0",
6768
"jest": "^29.6.3",
6869
"prettier": "^3.3.3",
6970
"prettier-plugin-tailwindcss": "^0.6.9",
7071
"react-native-svg-transformer": "^1.5.0",
7172
"react-test-renderer": "18.3.1",
72-
"@types/react-native-sqlite-storage": "^6.0.5",
73+
"tailwindcss": "^3.4.16",
7374
"typescript": "5.0.4"
7475
},
7576
"engines": {

src/screens/Home/HomeScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function Shortcuts({ navigation }: { navigation: StackNav }) {
114114
<Medium className='text-xs text-gray-700 dark:text-gray-300'>Shortcut 1</Medium>
115115
</TouchableOpacity>
116116
<TouchableOpacity
117-
onPress={() => navigation.navigate('Story')}
117+
onPress={() => navigation.navigate('Test')}
118118
style={[hw, styles.shadow, styles.center]}
119119
className='w-1/2 rounded-2xl bg-white dark:bg-zinc-900'
120120
>

src/screens/Test.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,21 @@ import { SettOption } from '@components/Settings/SettOption'
66
import SettText from '@components/Settings/SettText'
77
import SettWrapper from '@components/Settings/SettWrapper'
88
import type { NavProp } from '@utils/types'
9-
import React from 'react'
9+
import React, { useEffect } from 'react'
10+
11+
import { open } from '@op-engineering/op-sqlite'
12+
import { drizzle } from 'drizzle-orm/op-sqlite'
13+
14+
const opsqlite = open({
15+
name: 'myDB',
16+
})
17+
const db = drizzle(opsqlite)
1018

1119
export default function Test({ navigation }: NavProp) {
20+
useEffect(() => {
21+
console.log('db', db)
22+
}, [db])
23+
1224
return (
1325
<>
1426
<SettWrapper navigation={navigation} title='Test Screen'>

0 commit comments

Comments
 (0)