Skip to main content

Kongodb: Hybrid Row-and-Document Oriented datastore leveraging SQL/RDBMS database: SQLite, MySQL, MariaDB, Postgresql

Project description

Kongodb

Kongodb is Hybrid Row-and-Document Oriented datastore leveraging SQL/RDBMS database: SQLite, MySQL, MariaDB, Postgresql

Kongodb is both RDMBS + Document Oriented together.

It supports, regular SQL query along with Document Oriented and Key Value store.

Engine:

  • JSON
  • SQLite
  • Mariadb
  • PostgreSQL
  • MySQL

Install

pip install python-kongodb

Usage

from kongodb import kongodb

# Open the db
# or in memory > fun = kongodb()
fun = kongodb("./my.db")

# Select a collection. 
# Collection will be created automatically
# or explicitely > test = fun.select('test')
test = fun.test

# Get total entries
print(test.size)

# Insert an entry. It returns kongodb#Document
entry = test.insert({
  "name": "Fun",
  "type": "DB",
  "version": "1.0.0"
})

# Retrieve document by _id
_id = "9c5e5fbd05544700995c5fa3ca3ef214"
entry = test.get(_id)

# Access properties
entry.name # -> fun 
entry.type # -> DB
entry.version # -> 1.0.0

# Update a field
entry.update(version="1.0.1")
# ...or 
entry.update({"version": "1.0.1"})
#
entry.version # -> 1.0.1

# Delete entry
entry.delete()

# Search
results = test.find({"version:$gt": "1.0.0"})
for entry in results:
  print(entry.name)

~ API ~

Database

kongodb

#select

To select a collection in the database

fun = kongodb()

users = fun.select("users")

## or 

users = fun.users

#collections

List all the collections in the database

fun = kongodb()

users = fun.select("users")

## or 

users = fun.users

##D

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kongo-0.0.1.tar.gz (15.9 kB view hashes)

Uploaded Source

Built Distribution

kongo-0.0.1-py3-none-any.whl (17.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page