Skip to content
This repository was 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

dcb94f9 · Jan 7, 2021

History

6 Commits
May 1, 2019
May 1, 2019
May 1, 2019
May 1, 2019
May 1, 2019
May 1, 2019
Jan 7, 2021
May 1, 2019

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