Skip to content
This repository has been archived by the owner on Jan 7, 2021. It is now read-only.
/ realm-dart-ffi Public archive

Experimental Realm binding using dart:ffi preview support

License

Notifications You must be signed in to change notification settings

nhachicha/realm-dart-ffi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo is archived, please follow progress on https://github.com/blagoev/realm-dart for a preview release soon.

realm-dart-ffi

Experimental Realm binding using dart:ffi preview support.

This demo wraps the Realm database engine (C++) using a C like interface in order to build a simple Key/Value store, and expose it to dart.

Building

  • Build the Shared Object library containing Realm with a C wrapper
git clone https://github.com/nhachicha/realm-dart-ffi
cd realm-dart-ffi
git submodule update --init --recursive
cd lib/src/cpp
cmake .
make

Running

  Database d = Database("demo.realm");
  d.put("first name", "Nabil");
  String firstName = d.get("first name");
  • Run the example (from the root directory realm-dart-ffi)
realm-dart-ffi> pub get
realm-dart-ffi> pub run example/main

This should persist two keys, then retrieve them.

Creating database demo.realm
Put key: first name value: Nabil
Put key: last name value: Hachicha
Get key: first name
Get key: last name
Hello Nabil Hachicha
Closing database 

You can also inspect the generated Realm database using Realm Studio

About

Experimental Realm binding using dart:ffi preview support

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published