{"id":45248,"library":"kysely-expo-sqlite-dialect","title":"kysely-expo-sqlite-dialect","description":"A Kysely dialect for Expo SQLite that bridges the Kysely query builder with SQLite databases in React Native/Expo applications. Current stable version is 0.3.0. This dialect supports modern Expo SDK and provides type-safe SQL query building, pragmatic defaults for performance (WAL mode, synchronous, foreign keys), and features like change listeners and connection callbacks. It requires peer dependencies expo-sqlite >=13.0.0, kysely >=0.28.0, expo-modules-core, and react-native-web >=0.19.0. Key differentiator: integrates Kysely's type-safe SQL builder into Expo's SQLite API, enabling compile-time query validation with full TypeScript support.","status":"active","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/ejkkan/kysely-expo-sqlite-dialect","tags":["javascript","kysely","expo","sqlite","react-native","dialect","database","sql","query-builder","typescript"],"install":[{"cmd":"npm install kysely-expo-sqlite-dialect","lang":"bash","label":"npm"},{"cmd":"yarn add kysely-expo-sqlite-dialect","lang":"bash","label":"yarn"},{"cmd":"pnpm add kysely-expo-sqlite-dialect","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"The core Kysely library is a peer dependency required to use the dialect.","package":"kysely","optional":false},{"reason":"Expo SQLite module is required for database interaction in the Expo environment.","package":"expo-sqlite","optional":false},{"reason":"Required for web platform support; peer dependency.","package":"react-native-web","optional":true}],"imports":[{"note":"This is a named export, not a default export. Incorrect default import will cause TypeScript/JavaScript errors.","wrong":"import ExpoSQLiteDialect from 'kysely-expo-sqlite-dialect'","symbol":"ExpoSQLiteDialect","correct":"import { ExpoSQLiteDialect } from 'kysely-expo-sqlite-dialect'"},{"note":"Kysely is a named export from the kysely package. Common mistake: using default import which is not provided.","wrong":"import Kysely from 'kysely'","symbol":"Kysely","correct":"import { Kysely } from 'kysely'"},{"note":"The Database type is user-defined and not exported by kysely or this dialect. Do not import it.","wrong":"import { Database } from 'kysely'","symbol":"Database","correct":"interface Database { ... } // No import needed; user-defined type"}],"quickstart":{"code":"import { Kysely } from 'kysely';\nimport { ExpoSQLiteDialect } from 'kysely-expo-sqlite-dialect';\n\ninterface Database {\n  users: { id: number; name: string; email: string; created_at: Date };\n  posts: { id: number; user_id: number; title: string; content: string; created_at: Date };\n}\n\nconst db = new Kysely<Database>({\n  dialect: new ExpoSQLiteDialect({\n    database: 'myapp.db',\n    debug: __DEV__,\n    pragmas: {\n      journal_mode: 'WAL',\n      synchronous: 'NORMAL',\n      foreign_keys: 1,\n      cache_size: -2000,\n      temp_store: 'MEMORY',\n    },\n    onCreateConnection: async (db) => {\n      await db.execAsync('CREATE EXTENSION IF NOT EXISTS ...');\n    },\n  }),\n});\n\nasync function getAllUsers() {\n  return await db.selectFrom('users').selectAll().execute();\n}","lang":"typescript","description":"Creates a Kysely instance with Expo SQLite dialect and demonstrates a basic query to fetch all users."},"warnings":[{"fix":"Set journal_mode to 'DELETE' or conditionally set it only on iOS/Android using Platform.OS.","message":"WAL mode is not supported in wa-sqlite (web platform). If you enable WAL mode, the app will crash on web.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Ensure expo-sqlite is version 13.0.0 or later in your package.json.","message":"expo-sqlite version compatibility: The dialect requires expo-sqlite >=13.0.0. Using older versions may cause runtime errors.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Update kysely to version 0.28.0 or later.","message":"kysely version compatibility: The dialect requires kysely >=0.28.0. Older versions may lack required APIs.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Use import { ExpoSQLiteDialect } from 'kysely-expo-sqlite-dialect'.","message":"The dialect uses named export ('ExpoSQLiteDialect'), not default export. Using default import will cause a runtime error.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use with caution; only enable if you need reactive queries.","message":"The 'enableChangeListener' option may have performance implications on large datasets. Not recommended for production without testing.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Monitor changelog for updates; avoid relying on it in critical code.","message":"The 'finalizeUnusedStatementsBeforeClosing' option is experimental and its behavior may change in future versions.","severity":"deprecated","affected_versions":">=0.3.0"}],"env_vars":null,"search_vec":"'0.19.0':80 '0.28.0':70 '0.3.0':29 '13.0.0':68 'api':95 'applic':24 'bridg':13 'build':43 'builder':17,90,118 'callback':60 'chang':56 'compil':98 'compile-tim':97 'connect':59 'core':74 'current':25 'databas':20,114 'default':45 'depend':64 'dialect':5,8,31,113 'differenti':82 'enabl':96 'expo':3,10,34,66,72,92,108 'expo-modules-cor':71 'expo-sqlit':65 'featur':54 'foreign':51 'full':103 'integr':83 'javascript':106 'key':52,81 'kyse':2,7,15,69,84,107 'kysely-expo-sqlite-dialect':1 'like':55 'listen':57 'mode':49 'modern':33 'modul':73 'nativ':78,112 'native/expo':23 'peer':63 'perform':47 'pragmat':44 'provid':37 'queri':16,42,100,117 'query-build':116 'react':22,77,111 'react-nat':110 'react-native-web':76 'requir':62 'safe':40,88 'sdk':35 'sql':41,89,115 'sqlite':4,11,19,67,94,109 'stabl':26 'support':32,105 'synchron':50 'time':99 'type':39,87 'type-saf':38,86 'typescript':104,119 'valid':101 'version':27 'wal':48 'web':79","created_at":"2026-06-07T12:54:05.612684+00:00","updated_at":"2026-06-07T12:54:05.612684+00:00","problems":[{"fix":"Run: npm install kysely-expo-sqlite-dialect kysely expo-sqlite","cause":"Package not installed or not properly resolved.","error":"Cannot find module 'kysely-expo-sqlite-dialect' or its corresponding type declarations"},{"fix":"Ensure all peer dependencies are installed: expo-sqlite, kysely, and expo-modules-core. Then verify dialect options are passed correctly.","cause":"Attempting to use a Kysely instance without initializing the dialect correctly, or missing peer dependencies.","error":"TypeError: Cannot read properties of undefined (reading 'then')"},{"fix":"Execute CREATE TABLE statements via db.schema.createTable(...).execute() before running queries.","cause":"Table does not exist; the user forgot to run schema creation before queries.","error":"Error: SQLite3 at step: (node:*) Error: no such table: users"},{"fix":"Change to: import { ExpoSQLiteDialect } from 'kysely-expo-sqlite-dialect'","cause":"Using default import instead of named import.","error":"Type error: Property 'default' does not exist on type 'typeof import(\"kysely-expo-sqlite-dialect\")'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/ejkkan/kysely-expo-sqlite-dialect#readme","github":"https://github.com/ejkkan/kysely-expo-sqlite-dialect","docs":null,"changelog":null,"pypi":null,"npm":"kysely-expo-sqlite-dialect","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}