Lightweight, Thread-Safe, Version-Agnostic, SQL Client Implementation
Project description
AnySQL
Lightweight, Thread-Safe, Version-Agnostic, SQL Client Implementation inspired by Databases
Example
# Create a database instance, and connect to it.
from anysql import Database
database = Database('sqlite://:memory:')
database.connect()
# Create a table.
query = """CREATE TABLE HighScores (id INTEGER PRIMARY KEY, name VARCHAR(100), score INTEGER)"""
database.execute(query=query)
# Insert some data.
query = "INSERT INTO HighScores(name, score) VALUES (:name, :score)"
values = [
{"name": "Daisy", "score": 92},
{"name": "Neil", "score": 87},
{"name": "Carol", "score": 43},
]
database.execute_many(query=query, values=values)
# Run a database query.
query = "SELECT * FROM HighScores"
rows = database.fetch_all(query=query)
print('High Scores:', rows)
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
anysql-0.0.1.tar.gz
(12.4 kB
view details)
File details
Details for the file anysql-0.0.1.tar.gz
.
File metadata
- Download URL: anysql-0.0.1.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94af01fedeb983779c37ecfe2f3e78199b2cdb7c8c23b72392c9d7ef70dec891 |
|
MD5 | df039dd6cf9cef80bd886d8aae4c9ba8 |
|
BLAKE2b-256 | 351562239db373c97ad55fc0f417a78dc830b022e861dbcaffcbf0830f25073d |