Skip to content

Commit bd856da

Browse files
committed
Add drizzle config
1 parent e31dc35 commit bd856da

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module.exports = {
22
presets: ['module:@react-native/babel-preset', 'nativewind/babel'],
33
plugins: [
44
'react-native-reanimated/plugin',
5+
['inline-import', { extensions: ['.sql'] }],
56
[
67
'module-resolver',
78
{

drizzle.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { Config } from 'drizzle-kit'
2+
3+
export default {
4+
schema: './src/db/schema.ts',
5+
out: './src/drizzle',
6+
dialect: 'sqlite',
7+
driver: 'expo',
8+
} satisfies Config

metro.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const config = mergeConfig(defaultConfig, {
1616
},
1717
resolver: {
1818
assetExts: [...assetExts.filter((ext) => ext !== 'svg'), 'lottie'],
19-
sourceExts: [...sourceExts, 'svg'],
19+
sourceExts: [...sourceExts, 'svg', 'sql'],
2020
},
2121
})
2222

src/db/schema.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { int, sqliteTable, text } from 'drizzle-orm/sqlite-core'
2+
3+
export const usersTable = sqliteTable('users_table', {
4+
id: int().primaryKey({ autoIncrement: true }),
5+
name: text().notNull(),
6+
age: int().notNull(),
7+
email: text(),
8+
})

0 commit comments

Comments
 (0)