https://github.com/mfussenegger/crate-peewee
Crate driver for peewee
https://github.com/mfussenegger/crate-peewee
Last synced: 6 months ago
JSON representation
Crate driver for peewee
- Host: GitHub
- URL: https://github.com/mfussenegger/crate-peewee
- Owner: mfussenegger
- Created: 2015-12-01T16:52:31.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-17T21:23:26.000Z (over 9 years ago)
- Last Synced: 2025-03-16T16:40:50.716Z (7 months ago)
- Language: Python
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
============
crate-peewee
============.. image:: https://img.shields.io/pypi/wheel/crate-peewee.svg
:target: https://pypi.python.org/pypi/crate-peewee/
:alt: Wheel.. image:: https://img.shields.io/pypi/v/crate-peewee.svg
:target: https://pypi.python.org/pypi/crate-peewee/
:alt: PyPI Version.. image:: https://img.shields.io/pypi/pyversions/crate-peewee.svg
:target: https://pypi.python.org/pypi/crate-peewee/
:alt: Python VersionCrate 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 uuid4db = 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 = dbdb.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()])