Skip to main content

Universal, framework-independent ORM for Python.

Project description

Mosaic ORM Logo

MosaicDB

Universal, framework-independent ORM for Python.


Getting Started

from pydantic import BaseModel
from mosaicdb import Mosaic
from mosaicdb.models import ModelMixin

class User(BaseModel, ModelMixin):
	id: int
	name: str
	age: int

db = Mosaic("sqlite:///test.db")
User.create_table(db)
User.insert(db, User(id=1, name="Alice", age=30))
users = User.find(db)
print(users)

Features Table

Feature Supported
Simple Syntax
Multi-DB Support
Multi-Table/FK
Auto Migrations
CLI
Typesafe Models
NoSQL (MongoDB)
Error Handling
Test Coverage

Database Support Matrix

Database CRUD FKs Migrations CLI Typesafe Models
SQLite
MySQL
PostgreSQL
MongoDB Schemaless

CLI Command Examples

mosaicdb makemigrations users --db sqlite:///test.db --schema '{"id": "int", "name": "str"}'
mosaicdb migrate users --db sqlite:///test.db
mosaicdb create-table users --db sqlite:///test.db --schema '{"id": "int", "name": "str"}'
mosaicdb drop-table users --db sqlite:///test.db
mosaicdb inspect-schema users --db sqlite:///test.db
mosaicdb seed users --db sqlite:///test.db --data '{"id": 1, "name": "Alice"}'
mosaicdb raw-sql --db sqlite:///test.db --sql "SELECT * FROM users"

Versioning & Changelog

  • Current version: v0.1.0-alpha
  • See CHANGELOG.md for updates.

PyPI Installation

pip install mosaicdb

License

MIT

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

mosaicdb-0.1.1.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mosaicdb-0.1.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file mosaicdb-0.1.1.tar.gz.

File metadata

  • Download URL: mosaicdb-0.1.1.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for mosaicdb-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c7f8bdedf9fabb8baac7af25c6238ea33812b417e5373792a128e1434af135c2
MD5 461342c5d9102061a2bfab542ba1e94b
BLAKE2b-256 e42ec09600c05351097a7e45c60f29b7a7968231baa6077f042e58f802530b7d

See more details on using hashes here.

File details

Details for the file mosaicdb-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mosaicdb-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for mosaicdb-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 825d920cc2399a00dfc85e722934875ea1645d5f49728a9c43bf5af4a9dfff08
MD5 1c748b4af807f11dca400089cbce246a
BLAKE2b-256 66202a83b4337b717ec5f90fe04ea666d1cc0c780434d8da92e84b1ca84619b5

See more details on using hashes here.

Supported by

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