https://github.com/mcbabo/sqlight
https://github.com/mcbabo/sqlight
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mcbabo/sqlight
- Owner: mcbabo
- Created: 2022-08-06T21:30:50.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-08T07:03:07.000Z (almost 3 years ago)
- Last Synced: 2025-02-12T06:43:50.940Z (3 months ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SQLight #
SQL Wrapper for Python
[My Discord](https://discordapp.com/users/731128007388823592/ "Moritz⚜#6969")
## Instructions ##
### Install: ###
```py
pip install sqlight
# or
pip install -i https://test.pypi.org/simple/ sqlight
```### Information: ###
```
# Database object
Database.connect() -> None: connect to database
Database.close() -> None: close database
Database.table() -> Table: create Table object
Database.get_tables() -> list: list all Tables# Table object
Table.get_attributes() -> list: list all row names
Table.fetch_all() -> list: get content of table
Table.fetch_rows(list | str) -> list: get rows
Table.insert(dict) -> None: instert data into table
Table.delete() -> None: delete table
```### Run Program: ###
```py
# import webmath and asyncio
import asyncio
from sqlight import sqlight# connect to db
db = sqlight.Database("database.db")
asyncio.run(db.connect())# connect to table
mytable = asyncio.run(db.table("tablename"))# get content of table
content = asyncio.run(mytable.fetch_all())
print(content)
```### OUTPUT: ###
```py
[(0, 'id', 'INTEGER', 0, None, 0), (1, 'text', 'TEXT', 0, None, 0), (2, 'other', 'TEXT', 0, None, 0)]
```## Ride the space skyway home to 80s Miami ##