API
source: bluebase/api.py
The main API for creating, opening, and interacting with a database.
Example:
from pathlib import Path
from bluebase import BlueBase
bb = BlueBase(Path("test.db"))
bb.execute("CREATE TABLE student(id INT, name STRING(12));")
bb.execute("INSERT INTO student VALUES (1, 'Alice');")
result = bb.execute("SELECT name FROM student;")
for row in result:
print(row)
bb.close()
- dataclassclass Result(query: str, op: QlOp)[source]
Bases:
objectAn execution result.
- Variables:
query (str) – the input query
op (QlOp) – the operation for the query