Installation
Hypertill DB is published on npm as @hypertill/db.
If you want to see the package working before wiring it into your own app, open the TypeScript Expo demo:
Install the package
For most apps, start with npm:
npm install @hypertill/db
npm install -D @babel/plugin-proposal-decorators
If you already know you are building with Expo, install the dev client too:
npm install @hypertill/db expo-dev-client
npm install -D @babel/plugin-proposal-decorators
Recommended path: Expo SDK 54+
Hypertill DB 0.0.1 ships an Expo config plugin in the package. That is the easiest current way to get Android JSI wiring and native SQLite linked without manually editing Gradle files.
1. Register the package plugin
Add @hypertill/db to your Expo plugins list:
{
"expo": {
"plugins": ["@hypertill/db", "expo-dev-client"]
}
}
2. Enable legacy decorators in Babel
module.exports = function (api) {
api.cache(true)
return {
presets: ['babel-preset-expo'],
plugins: [['@babel/plugin-proposal-decorators', { legacy: true }]],
}
}
3. Build a native client
npx expo prebuild
npx expo run:android
npx expo run:ios
4. Important note about Expo Go
Hypertill DB uses native SQLite and JSI modules. That means Expo Go is not enough for this package. Use a dev build created through expo run:* or your own EAS build.
Bare React Native
If you are not using Expo, the package still works as a regular React Native native module.
1. Install the package
npm install @hypertill/db
npm install -D @babel/plugin-proposal-decorators
2. Enable decorators
{
"presets": ["module:metro-react-native-babel-preset"],
"plugins": [["@babel/plugin-proposal-decorators", { "legacy": true }]]
}
3. Install iOS pods
cd ios
pod install
4. Run your app
npx react-native run-android
npx react-native run-ios
Autolinking should handle the base native package automatically on modern React Native.
Manual Android JSI setup for bare apps
If you are not using the Expo plugin and want synchronous JSI mode on Android, add the extra native project manually.
In android/settings.gradle:
include ':watermelondb-jsi'
project(':watermelondb-jsi').projectDir =
new File(rootProject.projectDir, '../node_modules/@hypertill/db/native/android-jsi')
In android/app/build.gradle:
android {
packagingOptions {
pickFirst '**/libc++_shared.so'
}
}
dependencies {
implementation project(':watermelondb-jsi')
}
In android/app/proguard-rules.pro:
-keep class com.hypertill.db.** { *; }
Then register the package in MainApplication.kt or MainApplication.java:
import com.hypertill.db.jsi.HypertillDBJSIPackage
override fun getPackages(): List<ReactPackage> {
return PackageList(this).packages.apply {
add(HypertillDBJSIPackage())
}
}
The Gradle subproject name remains :watermelondb-jsi in 0.0.1 for compatibility, even though the Java package names are rebranded to com.hypertill.db.*.
Web and Node.js
Hypertill DB is not limited to native mobile apps:
- Use
SQLiteAdapterin Node.js - Use
LokiJSAdapterin the browser
The database bootstrap pattern is the same either way. The only thing that changes is the adapter implementation. Continue with Setup for the project structure.
Verify the install
Before building your real feature set, confirm these basics:
- the app boots on Android and iOS
- your
onSetUpErrorcallback does not fire - you can create one record and read it back
- your app is wrapped with
DatabaseProvider
Then move on to Setup and Connecting Components.