SQLBatis
Under Documentation
SQLBatis is a tool that inspired by the Mybatis, it provides an easier way to interact with the database through the raw sql.
SQLBatis allows you to migrate, update your database according to the data model you defined in your app.Also, there are several decorators and builtin functions which give you capbility to interact with your database.
Let's try it.
Requirements
Installation
Install SQLBatis with command pip::
pip install sqlbatis
Quick Tutorial
Connect to the DB
from sqlbatis import SQLBatis
db = SQLBatis('sqlite:///:memory:')
We have provided the decorator @db.query to execute the raw sql, Here are CRUD examples:
from sqlalchemy import Column, Integer, String
from sqlbatis import SQLBatis, Model
db = SQLBatis('sqlite:///:memory:')
class User(Model):
id = Column(Integer, primary_key=True)
name = Column(String)
full_name = Column(String)
@db.query('INSERT INTO user (name, full_name) VALUS(:name, :full_name)')
def create(name, full_name):
pass
@db.query('SELECT * FROM user')
def query_user():
pass
@db.query('UPDATE user SET name = :name WHERE id = :id')
def update_user(name, id):
pass
@db.query('DELETE FROM user WHERE id = :id')
def delete_user(id):
pass
if __name__ == '__main__':
create('10111000', 'Leo')
Documentation
Metadata
Release files for sqlbatis 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sqlbatis-0.9.0.tar.gz | 19.8 kB | Without provenance | Details for sqlbatis-0.9.0.tar.gz |
Release files / sqlbatis-0.9.0.tar.gz
| Download URL | sqlbatis-0.9.0.tar.gz |
|---|---|
| Size | 19.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3967343c8c442d6696b838bf8f7bdfbccb67ccd92a2dafe301ea8323be9068f7
|
|
BLAKE2b-256 checksum How to use checksums |
6e84f41ff0be68cd170036f2020edeb01f7f46f358e7e950e928c47ad56b2abe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Security for sqlbatis 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.