Skip to main content

Crate driver for peewee

Project description

Crate driver for peewee, a small, expressive ORM.

Most basic operations work. Support for special Crate features like fulltext search or object and array fields is still a work in progress.

For a full documentation take a look at the peewee documentation.

Usage

Use peewee with Crate:

from peewee import Model, CharField
from crate.peewee import CrateDatabase
from uuid import uuid4

db = CrateDatabase()
db.connect()

def gen_key():
    return str(uuid4())

class User(Model):
    id = CharField(null=True, default=gen_key, primary_key=True)
    name = CharField(null=True)
    class Meta:
        database = db

db.create_tables([User], safe=True)
arthur = User.create(name='Arthur')
db.execute_sql('refresh table user')

print([u for u in User.select(User.name).tuples()])

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

crate-peewee-0.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

crate_peewee-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file crate-peewee-0.1.0.tar.gz.

File metadata

File hashes

Hashes for crate-peewee-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f2afd8e7870a3c0f367580c576720f4d16e53f29c92f6f61cdfcb557f14b819f
MD5 b0c2493c54b4a2c975444cba6eaf2e90
BLAKE2b-256 991fae660211093af9d836acd8af57adfb5c2b785f6219b99c9bee47ba44ece8

See more details on using hashes here.

File details

Details for the file crate_peewee-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for crate_peewee-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 367e55d380988d1b43564f0eef8450a25e73b1d7f61069d9072fc8038b492033
MD5 646ca166cf93c3aba7db4139d094cc99
BLAKE2b-256 37cd5fcc70aab374292ecf16c74905506957631b73749391866478fad297c7a3

See more details on using hashes here.

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