Skip to content

fernando24164/flamel

Repository files navigation

Flamel Logo

python version CI

Table of Contents

➤ Description

A declarative ORM from scratch, compatible with SQLite

➤ Installation

Use the package manager pip to install flamel.

pip install flamel-orm

📚 Usage

from flamel.base import Base
from flamel.column import Column, Integer, String


class Worker(Base):
    id = Column("id", Integer, primary_key=True, autoincrement=True)
    name = Column("name", String, nullable=False, unique=True)
    email = Column("mail", String, nullable=False, unique=True)


Base.set_engine("company.db")

Base.create_tables()

worker = Worker(name='John Doe', email='[email protected]')
worker2 = Worker(name='Jane Smith', email='[email protected]')
worker3 = Worker(name='Mike Johnson', email='[email protected]')

Base.insert(worker)
Base.insert(worker2)
Base.insert(worker3)

query = Worker.query().select().filter(name="John Doe")
print(query)
result = query.execute()
print(result)

Base.engine_close()

➤ Roadmap

  • MVP of the ORM
  • Implement a way to insert data
  • Implement group_by
  • Implement having

➤ Credits

This project is thanks to other projects and people:

➤ License

Licensed under MIT.

About

A simple ORM for SQLite

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published