Socket
Book a DemoInstallSign in
Socket

mosaicdb

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mosaicdb

Universal, framework-independent ORM for Python.

pipPyPI
Version
0.1.1
Maintainers
1

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

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

Database Support Matrix

DatabaseCRUDFKsMigrationsCLITypesafe Models
SQLite
MySQL
PostgreSQL
MongoDBSchemaless

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

Keywords

orm database sql nosql sqlite mysql postgres mongodb

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts