@expo/knex-expo-sqlite-dialect
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@expo/knex-expo-sqlite-dialect

Knex.js dialect for Expo SQLite

Installation

  1. Install the package

yarn add @expo/knex-expo-sqlite-dialect

  1. Add babel preset to the babel.config.js
--- a/babel.config.js
+++ b/babel.config.js
@@ -3,6 +3,7 @@ module.exports = function (api) {
   return {
     presets: [
       'babel-preset-expo',
+      'module:@expo/knex-expo-sqlite-dialect/babel-preset',
     ],
   };
 };
  1. Add the custom dialect for knex constructor
import ExpoSQLiteDialect from '@expo/knex-expo-sqlite-dialect';
import Knex from 'knex';

const knex = Knex({
  client: ExpoSQLiteDialect,
  connection: {
    filename: 'MyDB.db',
  },
});

Components

packages/knex-expo-sqlite-dialect

The main package

babel-preset

Since Knex.js is developed on Node.js runtime, some of Node.js dependencies are not available on React Native. The Babel preset uses the babel-plugin-module-resolver plugin to alias these Node.js modules to other supported modules.

apps/example

The example app replicated from the with-sqlite example with Knex.js integration.

Readme

Keywords

Package Sidebar

Install

npm i @expo/knex-expo-sqlite-dialect

Weekly Downloads

22

Version

0.0.1

License

MIT

Unpacked Size

5.5 kB

Total Files

6

Last publish

Collaborators

  • szdziedzic
  • alanhughes
  • kadikraman
  • radoslawkrzemien
  • aleqsio
  • marklawlor
  • gabrieldonadel
  • simek
  • keith-kurak
  • christopherwalter
  • kbrandwijk
  • fiber-god
  • ide
  • brentvatne
  • evanbacon
  • quinlanj
  • expoadmin
  • tsapeta
  • exponent
  • wschurman
  • wkozyra
  • bycedric
  • lukmccall
  • jonsamp
  • princefleaswallow
  • kudochien