Coder Social home page Coder Social logo

dbcaml's Introduction

dbcaml logo

A database toolkit built on Riot

Quick Start | Documentation | Examples |   

DBCaml is a async database toolkit built on Riot, an actor-model multi-core scheduler for OCaml 5. DBCaml is inspired by Elixirs where the developer can spin up a connection manager and connections the manager takes cares of.

** Note: DBCaml is currently in development and is not ready for production. Only for testing purposes **

let driver =
    Dbcaml_driver_postgres.connection
      "postgresql://postgres:mysecretpassword@localhost:6432/development"
  in

  let pool_id = Dbcaml.start_link ~connections:10 driver |> Result.get_ok in

  (* Fetch 1 row from the database *)
  (match
     Dbcaml.fetch_one
       pool_id
       ~params:[Dbcaml.Param.String "1"]
       "select * from users where id = $1"
   with
  | Ok x ->
    let rows = Dbcaml.Row.row_to_type x in
    (* Iterate over each column and print it's values *)
    List.iter (fun x -> print_endline x) rows
  | Error x -> print_endline (Dbcaml.Res.execution_error_to_string x));


DBCaml aims to offer:

  • Database pooling. Built with using Riots lightweight process to spin up a connection pool.

  • Database Agnostic. Support for Postgres, and more to come(MySQL, MariaDB, SQLite)

  • Built in security. With built in security allows users to focus on writing queries and don't be afraid of security breaches.

  • Cross Platform. DBCaml compiles anywhere

  • Not an ORM. DBCaml is not an orm, it simple handle the boring stuff you don't want to deal with and allow you to have full insight on what's going on.

Quick Start

opam pin dbcaml.0.0.1 git+https://github.com/dbcaml/dbcaml

After that, you can use any of the examples as a base for your app, and run them:

dune exec ./my_app.exe

Important

DBCaml is in heavily development, the content in this repo will change

dbcaml's People

Contributors

emilpriver avatar wonbyte avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.