3 Star 0 Fork 0

Gitee 极速下载 / bedquiltdb

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/BedquiltDB/bedquilt-core
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Bedquilt

Join the chat at https://gitter.im/BedquiltDB/bedquilt-core

Bedquilt

BedquiltDB is a A JSON document-store built on PostgreSQL.

CircleCI

Releases

Release packages for BedquiltDB can be found on pgxn.

Goals

  • Borrow some of the good ideas and positive attributes of json object-stores and bring them to PostgreSQL
  • Harness the new jsonb functionality of PostgreSQL and wrap it in a nice programmatic API that is consistent across languages
  • Make use of SQL strong-points, such as schema constraints and table joins
  • Build a tool which is actually useful for developers

Documentation

Project documnetation hosted at Read The Docs.

To build documentation, install the mkdocs utility and run:

$ make docs

Examples

This extension provides the core functionality of BedquiltDB, and can be used from ordinary SQL queries, though it is recommended to use one of the driver libraries for you favourite programming language instead.

-- Insert two documents into the 'people' collection.
select bq_insert(
    'people',
    '{"_id": "sarah@example.com",
      "name": "Sarah",
      "likes": ["icecream", "code"]}'
);
select bq_insert(
    'people',
    '{"name": "Mike",
      "likes": ["code", "rabbits"]}'
);


-- Find a single document,
-- where the "name" field is the string value "Mike".
select bq_find_one(
    'people',
    '{"name":  "Mike"}'
);


-- Find all documents in the 'people' collection
select bq_find('people', '{}');


-- Find all people who like icecream
select bq_find('people', '{"likes": ["icecream"]}');


-- Find a single document by its "_id" field.
-- This query hits the primary key index on the _id field
select bq_find_one_by_id('people', 'sarah@example.com');


-- Create an empty collection
select bq_create_collection('things');


-- Get a list of existing collections
select bq_list_collections();

Drivers

BedquiltDB is intended to be used with client libraries (aka Drivers), such as:

Installation instructions and documentation for each driver can be found on the respective driver repositories.

BedquiltDB can also be used directly through SQL queries: select bq_find('users', '{...}').

Prerequisites

  • PostgreSQL >= 9.5
  • PL/pgSQL
  • PL/Python3u
  • The pgcrypto extension

Development prerequisites

  • python >=2.7
  • psycopg2 python library (pip install pyscopg2)
  • a local installation of PostgreSQL, with pgxs
  • mkdocs, for building documentation
  • gnu make

Installation

From a pre-built package (recommended)

To install BedquiltDB on your PostgreSQL server, follow the instructions here:

http://bedquiltdb.readthedocs.org/en/latest/guide/installation/

From source

If you would prefer to install from source, first clone this repositroy:

$ git clone https://github.com/BedquiltDB/bedquilt-core.git
$ cd bedquilt-core

Run the following to build the extension and install it to the local database:

$ sudo make install

Run this to build to a zip file:

$ make dist

Then, on the postgres server:

CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE EXTENSION IF NOT EXISTS plpython3u;
CREATE EXTENSION bedquilt;

Test out the bedquilt extension by running a simple find operation:

select bq_find('stuff', '{}');

Tests

Run make test to run the test suite. Requires a bedquilt_test database that the current user owns.

Contributing

Contributions are welcome, to any of the BedquiltDB projects. Just open an issue, or get in touch directly.

License

Bedquilt is released under the MIT License.

The MIT License (MIT) Copyright (c) 2023 June Kelly Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
PLpgSQL 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/mirrors/bedquiltdb.git
git@gitee.com:mirrors/bedquiltdb.git
mirrors
bedquiltdb
bedquiltdb
master

搜索帮助