All Projects → realm → Realm Kotlin

realm / Realm Kotlin

Licence: other
Kotlin Multiplatform and Android SDK for the Realm Mobile Database: Build Better Apps Faster.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Realm Kotlin

Sapphiredb
SapphireDb Server, a self-hosted, easy to use realtime database for Asp.Net Core and EF Core
Stars: ✭ 326 (+108.97%)
Mutual labels:  database, realtime-database
Redwood
A highly-configurable, distributed, realtime database that manages a state tree shared among many peers.
Stars: ✭ 218 (+39.74%)
Mutual labels:  database, realtime-database
Rxdb
🔄 A client side, offline-first, reactive database for JavaScript Applications
Stars: ✭ 16,670 (+10585.9%)
Mutual labels:  database, realtime-database
Event Reduce
An algorithm to optimize database queries that run multiple times
Stars: ✭ 589 (+277.56%)
Mutual labels:  database, realtime-database
Realm Core
Core database component for the Realm Mobile Database SDKs
Stars: ✭ 836 (+435.9%)
Mutual labels:  database, realtime-database
Statecraft
Manage state with finesse
Stars: ✭ 145 (-7.05%)
Mutual labels:  database, realtime-database
React Native Firebase
🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
Stars: ✭ 9,674 (+6101.28%)
Mutual labels:  database, realtime-database
Realm Java
Realm is a mobile database: a replacement for SQLite & ORMs
Stars: ✭ 11,232 (+7100%)
Mutual labels:  database, realtime-database
Tera
An Internet-Scale Database.
Stars: ✭ 1,846 (+1083.33%)
Mutual labels:  database
Myproxy
A sharding proxy for MYSQL databases
Stars: ✭ 153 (-1.92%)
Mutual labels:  database
Spark With Python
Fundamentals of Spark with Python (using PySpark), code examples
Stars: ✭ 150 (-3.85%)
Mutual labels:  database
Slimdump
A tool for creating configurable dumps of large MySQL-databases.
Stars: ✭ 151 (-3.21%)
Mutual labels:  database
Chunked
Chunkwise Text-file Processing for 'dplyr'
Stars: ✭ 153 (-1.92%)
Mutual labels:  database
Grimoire
Database access layer for golang
Stars: ✭ 151 (-3.21%)
Mutual labels:  database
Us Car Models Data
This repo contains approximately 10K car models data that are available in the United States between 1992-2020
Stars: ✭ 154 (-1.28%)
Mutual labels:  database
Interview
Android、Java程序员面试资源总结,涉及Java、Android、网络、操作系统、算法等
Stars: ✭ 150 (-3.85%)
Mutual labels:  database
Deno Sqlite
Deno SQLite module
Stars: ✭ 151 (-3.21%)
Mutual labels:  database
Express Typescript Boilerplate
A delightful way to building a RESTful API with NodeJs & TypeScript by @w3tecch
Stars: ✭ 2,293 (+1369.87%)
Mutual labels:  database
Flask Migrate
SQLAlchemy database migrations for Flask applications using Alembic
Stars: ✭ 1,971 (+1163.46%)
Mutual labels:  database
Norm
Access a database in one line of code.
Stars: ✭ 152 (-2.56%)
Mutual labels:  database

Realm

License

Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for the Kotlin SDK for Realm, which runs on Kotlin Multiplatform and Android.

Quick Startup Video

Define your model

@RealmObject
class Person : RealmModel {
    var name: String = ""
    var age: Int = 0
}

Other primitive types are supported: Char, Byte, Short, Long, Boolean, Float, Double

Define your schema and open a Realm

@RealmModule(Person::class)
class MySchema

val configuration = RealmConfiguration.Builder(schema = MySchema()).build()
var realm: Realm = Realm.open(configuration)

Write Transaction

realm.beginTransaction()
// create a new persisted instance
val person = realm.create(Person::class).apply {
        name = "Foo"
        age = 42
}
realm.commitTransaction()

Query

  • Querying all objects of a certain type.
val objects: RealmResults<Person> = realm.objects(Person::class)
  • Querying using a predicate.
val objects: RealmResults<Person> =
            realm.objects(Person::class).query("name == $0", "Foo")

Next: head to the full KMM example.

Developer Preview

The Realm Kotlin SDK is in Developer Preview. All API's might change without warning and no guarantees are given about stability. Do not use in production.

Design documents

The public API of the SDK has not been finalized. Design discussions will happen in both Google Doc and this Github repository. Most bigger features will first undergo a design process that might not involve code. These design documents can be found using the following links:

How to build:

Prerequisits

  • Swig. On Mac this can be installed using Homebrew: brew install swig.

Commands to build

git submodule update --init --recursive
cd test
./gradlew assemble

In Android Studio open the test project, which will open also the realm-library and the compiler projects

Using Snapshots

If you want to test recent bugfixes or features that have not been packaged in an official release yet, you can use a -SNAPSHOT release of the current development version of Realm via Gradle, available on JFrog OSS

// Global build.gradle
buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'http://oss.jfrog.org/artifactory/oss-snapshot-local'
        }
        maven {
            url 'https://dl.bintray.com/kotlin/kotlin-dev'
        }
    }
    dependencies {
        classpath 'io.realm.kotlin:plugin-gradle:<VERSION>'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'http://oss.jfrog.org/artifactory/oss-snapshot-local'
        }
        maven {
            url 'https://dl.bintray.com/kotlin/kotlin-dev'
        }
    }
}

See Config.kt for the latest version number.

Repository Guidelines

Branch Strategy

We have three branches for shared development: master, releases and next-major. Tagged releases are only made from releases.

master:

  • Target branch for new features.
  • Cotains the latest publishable state of the SDK.
  • SNAPSHOT releases are being created for every commit.

releases:

  • All tagged releases are made from this branch.
  • Target branch for bug fixes.
  • Every commit should be merged back to master master.
  • Minor changes (e.g. to documentation, tests, and the build system) may not affect end users but should still be merged to releases to avoid diverging too far from master and to reduce the likelihood of merge conflicts.

next-major:

  • Target branch for breaking changes that would result in a major version bump.

Note: We currently only have the master branch, as no tagged releases have been made yet.

Code Style

We use the offical style guide from Kotlin which is enforced using ktlint and detekt.

# Call from root folder to check if code is compliant.
./gradlew ktlintCheck
./gradlew detekt

# Call from root folder to automatically format all Kotlin code according to the code style rules.
./gradlew ktlintFormat

Note: ktlint does not allow group imports using .*. You can configure IntelliJ to disallow this by going to preferences Editor > Code Style > Kotlin > Imports and select "Use single name imports".

Defining dependencies

All dependency versions and other constants we might want to share between projects are defined inside the file buildSrc/src/main/kotlin/Config.kt. Any new dependencies should be added to this file as well, so we only have one location for these.

Contributing Enhancements

We love contributions to Realm! If you'd like to contribute code, documentation, or any other improvements, please file a Pull Request on our GitHub repository. Make sure to accept our CLA!

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

CLA

Realm welcomes all contributions! The only requirement we have is that, like many other projects, we need to have a Contributor License Agreement (CLA) in place before we can accept any external code. Our own CLA is a modified version of the Apache Software Foundation’s CLA.

Please submit your CLA electronically using our Google form so we can accept your submissions. The GitHub username you file there will need to match that of your Pull Requests. If you have any questions or cannot file the CLA electronically, you can email [email protected].

Samples

Kotlin Multiplatform Sample

The folder examples/kmm-sample contains an example showing how to use Realm in a multiplatform project, sharing code for using Realm in the shared module. The project is based on https://github.com/Kotlin/kmm-sample.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].