OOP abstraction/wrapper for work with SQL data bases
Project description
OOPDB
OOPDB - OOP wrapper for work with database. For now it's based on sqlite3 python lib.
Supported database features
- Data types
- Integer (DataTypes.INTEGER) - simple type for storing integer numbers
- Text (DataTypes.TEXT) - simple type for storing text/strings with a maximum length of 65'535 bytes
- Rows styling
- Dictionary - result on fetch will be list of dictionaries with keys equals to column names that was used in query
- Tuple - result on fetch will be list of tuples with value order equals to column names order that was used in query
- Expression
- Equal - checks that value in table with given column name matches some given value
- Greater than - checks that value in table with given column name bigger than some given value
- Less than - checks that value in table with given column name less than some given value
- Greater than or equal - checks that value in table with given column name bigger than some given value or equal
- Less than or equal - checks that value in table with given column name less than some given value or equal
- Not equal - checks that value in table with given column name doesn't match some given value
- Like - checks that value in table with given column name matches some given pattern
- Between - checks that value in table with given column name matches some given interval
- In - checks that value in table with given column name consists in the given list of values
- Or - boolean operation that concatenates some other two expressions
- And - boolean operation that concatenates some other two expressions
- Not - negates some expression
- Column configurations
- Column config - base abstraction for describing column configuration using following information
- Name
- Nullability
- Type - type from DataTypes
- Primary key - abstraction based on column config abstraction using following additional information
- Autoincrement
- Foreign key - abstraction based on column config abstraction using following additional information
- Reference table name
- Reference column name
- Column config - base abstraction for describing column configuration using following information
- Commands
- Create table - creates table with the given name and list of column configurations
- Select - select data from the given table and list of given column names in the table
- Distinct - optional configuration for select command to retrieve unique values
- Table names - get all table names that are exist in database
- Column names - get all column names that are exist in the table with the given table name
- Insert into - append row values to the table with the given name and list of column names
- Select count - select row count from the table with the given name
- Distinct - optional configuration for select count command to retrieve count of the unique column values
- Inner join - merges two tables with the given table names and column names
- Order by - sort result by the given lists of column names and orders for each column
- Update - updates the table with the given name by the given lists of column names and new values for that columns
- Where - adds some condition based on Expression abstraction to the database queries
- Delete - deletes rows using conditions
- Last row id - returns the latest row's id that was inserted to the given table
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
oopdb-0.0.5.tar.gz
(8.1 kB
view details)
Built Distribution
oopdb-0.0.5-py3-none-any.whl
(8.1 kB
view details)
File details
Details for the file oopdb-0.0.5.tar.gz
.
File metadata
- Download URL: oopdb-0.0.5.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cc2c7c50a1b099cc99492776b67b7ce5f4ef6ba5afc8d243541556b25016926 |
|
MD5 | 9b8832beaa11e3110f37076774763437 |
|
BLAKE2b-256 | 7fbb50fa5b796a355e2abbf65fc83aaf77c9971ccacd97c1f206de0b5da7339f |
File details
Details for the file oopdb-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: oopdb-0.0.5-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a82eae5c29602c2e20d20ae957b85d765bd1408b1a3c7e68d1991ede7d85bf66 |
|
MD5 | 004c63ea822dd9dfc8a1c9bc6e281d54 |
|
BLAKE2b-256 | 2149008094d5afac69fef0fc959690eec62013586e459692e30d77e80db62f22 |