CREATE EXTENSION bedquilt;

A JSON doc-store built on PostgreSQL

BedquiltDB builds upon the rock-solid foundation of PostgreSQL
to provide a simple, developer-friendly NoSQL API.

The Best of Both Worlds

BedquiltDB presents a simple NoSQL API to the developer, while persisting data to PostgreSQL. Enjoy straight-forward JSON persistence and querying, combined with the strengths of a relational database, such as field constraints and multi-document, multi-collection transactions

Lots of Client Libraries

BedquiltDB is implemented as a PostgreSQL extension, making it easy to create client libraries/drivers. Official drivers for Python, NodeJS and Clojure are already available.

Open Source

BedquiltDB is open-source, under the BSD License. Contributions are, of course, more than welcome. Check out our code on Github!

Examples


Python

from pybedquilt import BedquiltClient

bq = BedquiltClient(dbname='bedquilt_test')
projects = bq['projects']

projects.add_constraints({
    'description': {'$required': 1,
                    '$notnull': 1,
                    '$type': 'string'},
    'tags': {'$required': 1,
             '$type': 'array'}
})

projects.insert({
    '_id':   "BedquiltDB",
    'description': "A ghastly hack.",
    'quality': "pre-alpha",
    'tags': ["json", "postgres", "api"]
})

early_projects = projects.find(
    {'quality': 'pre-alpha'})

api_projects = projects.find(
    {'tags': ['api']})

cool_project = projects.find_one_by_id('BedquiltDB')
            

NodeJS

let bq = require('bedquilt')
let BedquiltClient = bq.BedquiltClient;

BedquiltClient.connect('localhost', (err, client) => {
  let tools = client.collection('tools');

  tools.find({type: 'blunt'}, (err, results) => {
    console.log(results);
  });

});

SQL

select bq_insert(
  'orders',
  '{"_id": "2001515",
    "customerId": "117176",
    "items": ["orange_coat",
              "socks",
              "plastic_teeth"]}'
);

select bq_find(
  'orders',
  '{"customerId": "220011",
    "items": ["socks"]}'
);

select bq_remove_one(
  'orders',
  '{"_id": "4401515"}'
);

Roadmap

  • Update, with partial modification of documents
  • Indexes to collection fields
  • Client transaction API
  • Collection namespaces
  • And much more!

Projects

bedquilt-core - The main PostgreSQL extension. (docs)

pybedquilt - The official Python driver for BedquiltDB. (docs)

node-bedquilt - The official Node.js driver for BedquiltDB. (docs)

clj-bedquilt - The official Clojure driver for BedquiltDB. (docs)

About

BedquiltDB is a super-cool open source project.

Social Links

   

What's with the crazy name?

Go play Kentucky Route Zero, then you'll get it.