All Projects → gahabeen → Biota

gahabeen / Biota

Licence: mit
A simple database framework for Fauna

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Biota

Faunadb Python
Python driver for FaunaDB
Stars: ✭ 75 (+38.89%)
Mutual labels:  database, driver, client
Nodejs Driver
DataStax Node.js Driver for Apache Cassandra
Stars: ✭ 1,074 (+1888.89%)
Mutual labels:  database, driver, client
Faunadb Js
Javascript driver for FaunaDB
Stars: ✭ 498 (+822.22%)
Mutual labels:  database, driver, client
Cdrs
Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async
Stars: ✭ 314 (+481.48%)
Mutual labels:  database, driver, client
Gocql
Package gocql implements a fast and robust Cassandra client for the Go programming language.
Stars: ✭ 2,182 (+3940.74%)
Mutual labels:  database, driver, client
Faunadb Go
Go driver for FaunaDB
Stars: ✭ 140 (+159.26%)
Mutual labels:  database, driver, client
Csharp Driver
DataStax C# Driver for Apache Cassandra
Stars: ✭ 477 (+783.33%)
Mutual labels:  database, driver, client
Postgres
Postgres.js - The Fastest full featured PostgreSQL client for Node.js
Stars: ✭ 2,193 (+3961.11%)
Mutual labels:  database, driver, client
Druidry
Java based Druid Query Generator library
Stars: ✭ 174 (+222.22%)
Mutual labels:  query-builder, database, client
Faunadb Jvm
Scala and Java driver for FaunaDB
Stars: ✭ 50 (-7.41%)
Mutual labels:  database, driver, client
Katanaframework
The New Hacking Framework
Stars: ✭ 502 (+829.63%)
Mutual labels:  framework, client
Arangojs
The official ArangoDB JavaScript driver.
Stars: ✭ 503 (+831.48%)
Mutual labels:  database, driver
Clickhouse Driver
ClickHouse Python Driver with native interface support
Stars: ✭ 562 (+940.74%)
Mutual labels:  database, driver
Laravel Eloquent Query Cache
Adding cache on your Laravel Eloquent queries' results is now a breeze.
Stars: ✭ 529 (+879.63%)
Mutual labels:  query-builder, database
Ruby Pg
A PostgreSQL client library for Ruby
Stars: ✭ 446 (+725.93%)
Mutual labels:  database, client
Vibora
Fast, asynchronous and elegant Python web framework.
Stars: ✭ 5,734 (+10518.52%)
Mutual labels:  framework, client
Mongo Cxx Driver
C++ Driver for MongoDB
Stars: ✭ 792 (+1366.67%)
Mutual labels:  database, driver
Qmgo
Qmgo - The Go driver for MongoDB. It‘s based on official mongo-go-driver but easier to use like Mgo.
Stars: ✭ 444 (+722.22%)
Mutual labels:  database, driver
Neo4j Javascript Driver
Neo4j Bolt driver for JavaScript
Stars: ✭ 674 (+1148.15%)
Mutual labels:  database, driver
Reactivemongo
🍃 Non-blocking, Reactive MongoDB Driver for Scala
Stars: ✭ 825 (+1427.78%)
Mutual labels:  database, driver

Biota has been living for a while in a new dedicated Organization over there: https://github.com/biotajs

Developement is on hold before I find some time to make it available to the world :)

Gabin.


biota

A simple database framework to start your next project in 30s with FaunaDB

Feature requests npm npm GitHub npm bundle size

Find the raw documentation here.

import { Biota } from "biota";
// 4 lines to:
const db = new Biota({ secret: "<your-secret>" });

// - scaffold the whole database (inc. users collection for ex)
await db.foundation();

// - add todos collection
await db.collection("todos").scaffold();

// - add autocomplete-search on name field
await db.collection("todos").index({ field: "name", ngram: true });
// 4 lines to:
// - create a user & login
let asUser = await db.user().register("[email protected]", "password", {
  nickname: "Georgy",
});

// - create a todo
await asUser.documents("todos").insert({ name: "Remember to star this project" });

// - query a todo with $ngram (autocomplete behavior)
await asUser.documents("todos").find({ name: { $ngram: "star" } });
// output: [{ ref, ts, data: { name: "Remember to star this project" } }]

Current status

Finishing up design and tests of the main API (400+ methods).

🙃 You're on preview release. Don't get scared though, the api is pretty stable but tests need to be added to be fool-proof. (Thus, as of yet, Biota isn't production ready)

❤️ Check the features and request the ones you would love to see in biota. (They arn't all listed yet!)

Found some errors? Let us know!

Getting Started

These instructions will take you through the few steps to get started playing with your Fauna database.

Prerequisites

You'll need to add biota either as a global or local (project) dependency.

yarn add biota // -G for global
// or
npm i biota // -G for global

Import

import { Biota } from "biota";
// or
const { Biota } = require("biota");

Instance

There are two ways to instantiate Biota.

  1. You can use a admin/server key (or any secret key) as a paremeter.
const db = new Biota({ secret: "<your-secret>"})
// example
await db.query( q.Create(...) )
  1. You can use the function .login(id, password) to log a user.
const db = new Biota()
const logged = await db.login("123", "super_password123")
// which is a shortcut for
const logged = await db.current.user.login("123", "super_password123")

// example
await logged.query( q.Create(...) )

Api

Even though you can query your database (same as you would do with the same fauna method query), the main power of Biota lives in its extended api.

Patience: It's coming.. :)

Helpers

const { q, factory, Page } = require('biota')
// q: export the query builder, same as fauna.query
q.If(..., true, false)
// factory: export the factory api (helpers that wrap FQL)
factory.database(ctx)(name).insert(options)

Running the tests

If you want to run the tests, you'll need to provide a FAUNA_KEY_TEST=<your-test-key> in a .env file.

⚠️ Careful: At the moment tests covering everything yet. PR welcomed 😉

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Gabin Desserprit instigator

See also the list of contributors who participated in this project. Join us 🍻

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

This lib wouldn't exist if I had not dug deep into Fauna FQL and got helped through the Fauna's slack community channel. In no order, I'ld like to thank, for their help and support, fauna's team (Brecht De Rooms, Ben Edwards, Marrony Neris, Leo Regnier, Summer, ,...) as well as other users like Eigil Sagafos 🙏

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].