CREATE EXTENSION bedquilt;
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
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.
BedquiltDB is open-source, under the BSD License. Contributions are, of course, more than welcome. Check out our code on Github!
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')
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);
});
});
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"}'
);
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)