odbms 0.3.3__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odbms-0.3.4/PKG-INFO +98 -0
- odbms-0.3.4/README.md +73 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms/app.py +1 -1
- {odbms-0.3.3 → odbms-0.3.4}/odbms/model.py +4 -1
- odbms-0.3.4/odbms.egg-info/PKG-INFO +98 -0
- {odbms-0.3.3 → odbms-0.3.4}/setup.py +1 -1
- odbms-0.3.3/PKG-INFO +0 -33
- odbms-0.3.3/README.md +0 -8
- odbms-0.3.3/odbms.egg-info/PKG-INFO +0 -33
- {odbms-0.3.3 → odbms-0.3.4}/LICENSE +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/MANIFEST.in +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms/__init__.py +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms/database.py +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms/dbms.py +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms/field.py +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms/orms/__init__.py +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms/orms/base.py +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms/orms/mongodb.py +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms/orms/mysqldb.py +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms/orms/postgresqldb.py +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms/orms/sqlitedb.py +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms/validators.py +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms.egg-info/SOURCES.txt +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms.egg-info/dependency_links.txt +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms.egg-info/requires.txt +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/odbms.egg-info/top_level.txt +0 -0
- {odbms-0.3.3 → odbms-0.3.4}/setup.cfg +0 -0
odbms-0.3.4/PKG-INFO
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: odbms
|
|
3
|
+
Version: 0.3.4
|
|
4
|
+
Summary: Database client for Mysql, MongoDB and Sqlite
|
|
5
|
+
Author: Amos Amissah
|
|
6
|
+
Author-email: theonlyamos@gmail.com
|
|
7
|
+
Project-URL: Source, https://github.com/theonlyamos/odbms/
|
|
8
|
+
Project-URL: Tracker, https://github.com/theonlyamos/odbms/issues
|
|
9
|
+
Keywords: python3 runit developer serverless architecture docker sqlite mysql mongodb
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: python-dotenv
|
|
23
|
+
Requires-Dist: pymongo
|
|
24
|
+
Requires-Dist: psycopg2
|
|
25
|
+
|
|
26
|
+
# odbms
|
|
27
|
+
|
|
28
|
+
odbms is a Python package for managing MySQL, MongoDB, SQLite, and PostgreSQL database instances.
|
|
29
|
+
|
|
30
|
+
## Features
|
|
31
|
+
|
|
32
|
+
- Supports multiple database management systems (MySQL, MongoDB, SQLite, PostgreSQL)
|
|
33
|
+
- Provides a unified interface for database operations across different DBMSs
|
|
34
|
+
- Includes an ORM-like model system for easy data manipulation
|
|
35
|
+
- Supports table creation, alteration, and basic CRUD operations
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
Install odbms using pip:
|
|
40
|
+
|
|
41
|
+
```shell
|
|
42
|
+
pip install odbms
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from odbms import DBMS
|
|
49
|
+
|
|
50
|
+
# Initialize with default settings
|
|
51
|
+
DBMS.initialize_with_defaults('sqlite', 'database_name')
|
|
52
|
+
|
|
53
|
+
# Or initialize with custom settings
|
|
54
|
+
DBMS.initialize('postgresql', port=5432, username='postgres', password='', database='database_name')
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from odbms import Model
|
|
59
|
+
|
|
60
|
+
class User(Model):
|
|
61
|
+
TABLE_NAME = 'users'
|
|
62
|
+
|
|
63
|
+
def init(self, email: str, name: str, password: str, image: str = '', gat: str ='', grt: str ='', created_at=None, updated_at=None, id=None):
|
|
64
|
+
super().init(created_at, updated_at, id)
|
|
65
|
+
|
|
66
|
+
self.email = email
|
|
67
|
+
self.name = name
|
|
68
|
+
self.password = password
|
|
69
|
+
self.image = image
|
|
70
|
+
self.gat = gat
|
|
71
|
+
self.grt = grt
|
|
72
|
+
|
|
73
|
+
#Create the table if not mongodb (sqlite, mysql, postgresql)
|
|
74
|
+
User.create_table()
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
# Insert a new user
|
|
79
|
+
new_user = User('test@user.com', 'Test User', 'MyPassword')
|
|
80
|
+
new_user.save()
|
|
81
|
+
|
|
82
|
+
# Retrieve all users
|
|
83
|
+
users = User.all()
|
|
84
|
+
|
|
85
|
+
# Find a specific user
|
|
86
|
+
user = User.find_one({'email': 'test@user.com'})
|
|
87
|
+
|
|
88
|
+
# Update a user
|
|
89
|
+
user.name = 'Updated Name'
|
|
90
|
+
user.save()
|
|
91
|
+
|
|
92
|
+
# Get the json representation of the user
|
|
93
|
+
user.json()
|
|
94
|
+
|
|
95
|
+
# Delete a user
|
|
96
|
+
Delete a user
|
|
97
|
+
User.remove({'email': 'test@user.com'})
|
|
98
|
+
```
|
odbms-0.3.4/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# odbms
|
|
2
|
+
|
|
3
|
+
odbms is a Python package for managing MySQL, MongoDB, SQLite, and PostgreSQL database instances.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Supports multiple database management systems (MySQL, MongoDB, SQLite, PostgreSQL)
|
|
8
|
+
- Provides a unified interface for database operations across different DBMSs
|
|
9
|
+
- Includes an ORM-like model system for easy data manipulation
|
|
10
|
+
- Supports table creation, alteration, and basic CRUD operations
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
Install odbms using pip:
|
|
15
|
+
|
|
16
|
+
```shell
|
|
17
|
+
pip install odbms
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
from odbms import DBMS
|
|
24
|
+
|
|
25
|
+
# Initialize with default settings
|
|
26
|
+
DBMS.initialize_with_defaults('sqlite', 'database_name')
|
|
27
|
+
|
|
28
|
+
# Or initialize with custom settings
|
|
29
|
+
DBMS.initialize('postgresql', port=5432, username='postgres', password='', database='database_name')
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from odbms import Model
|
|
34
|
+
|
|
35
|
+
class User(Model):
|
|
36
|
+
TABLE_NAME = 'users'
|
|
37
|
+
|
|
38
|
+
def init(self, email: str, name: str, password: str, image: str = '', gat: str ='', grt: str ='', created_at=None, updated_at=None, id=None):
|
|
39
|
+
super().init(created_at, updated_at, id)
|
|
40
|
+
|
|
41
|
+
self.email = email
|
|
42
|
+
self.name = name
|
|
43
|
+
self.password = password
|
|
44
|
+
self.image = image
|
|
45
|
+
self.gat = gat
|
|
46
|
+
self.grt = grt
|
|
47
|
+
|
|
48
|
+
#Create the table if not mongodb (sqlite, mysql, postgresql)
|
|
49
|
+
User.create_table()
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
# Insert a new user
|
|
54
|
+
new_user = User('test@user.com', 'Test User', 'MyPassword')
|
|
55
|
+
new_user.save()
|
|
56
|
+
|
|
57
|
+
# Retrieve all users
|
|
58
|
+
users = User.all()
|
|
59
|
+
|
|
60
|
+
# Find a specific user
|
|
61
|
+
user = User.find_one({'email': 'test@user.com'})
|
|
62
|
+
|
|
63
|
+
# Update a user
|
|
64
|
+
user.name = 'Updated Name'
|
|
65
|
+
user.save()
|
|
66
|
+
|
|
67
|
+
# Get the json representation of the user
|
|
68
|
+
user.json()
|
|
69
|
+
|
|
70
|
+
# Delete a user
|
|
71
|
+
Delete a user
|
|
72
|
+
User.remove({'email': 'test@user.com'})
|
|
73
|
+
```
|
|
@@ -119,7 +119,7 @@ class Model():
|
|
|
119
119
|
if DBMS.Database.dbms != 'mongodb':
|
|
120
120
|
# Fetch existing columns from the database
|
|
121
121
|
fetch_columns_sql = f"SELECT column_name FROM information_schema.columns WHERE table_name='{cls.TABLE_NAME}';"
|
|
122
|
-
existing_columns = {row['column_name'] for row in DBMS.Database.execute(fetch_columns_sql)}
|
|
122
|
+
existing_columns = {row['column_name'] for row in DBMS.Database.execute(fetch_columns_sql)} # type: ignore
|
|
123
123
|
default_columns = {'id', 'created_at', 'updated_at'}
|
|
124
124
|
# Determine columns to add or modify and columns to drop
|
|
125
125
|
specified_columns = set(changes.keys())
|
|
@@ -371,6 +371,9 @@ class Model():
|
|
|
371
371
|
@param params
|
|
372
372
|
@return List[Model]
|
|
373
373
|
'''
|
|
374
|
+
if isinstance(projection, list):
|
|
375
|
+
if len(projection) and 'id' not in projection:
|
|
376
|
+
projection.append('id')
|
|
374
377
|
|
|
375
378
|
result = cls.normalise(DBMS.Database.find_one(cls.TABLE_NAME, cls.normalise(params, 'params'), projection)) # type: ignore
|
|
376
379
|
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: odbms
|
|
3
|
+
Version: 0.3.4
|
|
4
|
+
Summary: Database client for Mysql, MongoDB and Sqlite
|
|
5
|
+
Author: Amos Amissah
|
|
6
|
+
Author-email: theonlyamos@gmail.com
|
|
7
|
+
Project-URL: Source, https://github.com/theonlyamos/odbms/
|
|
8
|
+
Project-URL: Tracker, https://github.com/theonlyamos/odbms/issues
|
|
9
|
+
Keywords: python3 runit developer serverless architecture docker sqlite mysql mongodb
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: python-dotenv
|
|
23
|
+
Requires-Dist: pymongo
|
|
24
|
+
Requires-Dist: psycopg2
|
|
25
|
+
|
|
26
|
+
# odbms
|
|
27
|
+
|
|
28
|
+
odbms is a Python package for managing MySQL, MongoDB, SQLite, and PostgreSQL database instances.
|
|
29
|
+
|
|
30
|
+
## Features
|
|
31
|
+
|
|
32
|
+
- Supports multiple database management systems (MySQL, MongoDB, SQLite, PostgreSQL)
|
|
33
|
+
- Provides a unified interface for database operations across different DBMSs
|
|
34
|
+
- Includes an ORM-like model system for easy data manipulation
|
|
35
|
+
- Supports table creation, alteration, and basic CRUD operations
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
Install odbms using pip:
|
|
40
|
+
|
|
41
|
+
```shell
|
|
42
|
+
pip install odbms
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from odbms import DBMS
|
|
49
|
+
|
|
50
|
+
# Initialize with default settings
|
|
51
|
+
DBMS.initialize_with_defaults('sqlite', 'database_name')
|
|
52
|
+
|
|
53
|
+
# Or initialize with custom settings
|
|
54
|
+
DBMS.initialize('postgresql', port=5432, username='postgres', password='', database='database_name')
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from odbms import Model
|
|
59
|
+
|
|
60
|
+
class User(Model):
|
|
61
|
+
TABLE_NAME = 'users'
|
|
62
|
+
|
|
63
|
+
def init(self, email: str, name: str, password: str, image: str = '', gat: str ='', grt: str ='', created_at=None, updated_at=None, id=None):
|
|
64
|
+
super().init(created_at, updated_at, id)
|
|
65
|
+
|
|
66
|
+
self.email = email
|
|
67
|
+
self.name = name
|
|
68
|
+
self.password = password
|
|
69
|
+
self.image = image
|
|
70
|
+
self.gat = gat
|
|
71
|
+
self.grt = grt
|
|
72
|
+
|
|
73
|
+
#Create the table if not mongodb (sqlite, mysql, postgresql)
|
|
74
|
+
User.create_table()
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
# Insert a new user
|
|
79
|
+
new_user = User('test@user.com', 'Test User', 'MyPassword')
|
|
80
|
+
new_user.save()
|
|
81
|
+
|
|
82
|
+
# Retrieve all users
|
|
83
|
+
users = User.all()
|
|
84
|
+
|
|
85
|
+
# Find a specific user
|
|
86
|
+
user = User.find_one({'email': 'test@user.com'})
|
|
87
|
+
|
|
88
|
+
# Update a user
|
|
89
|
+
user.name = 'Updated Name'
|
|
90
|
+
user.save()
|
|
91
|
+
|
|
92
|
+
# Get the json representation of the user
|
|
93
|
+
user.json()
|
|
94
|
+
|
|
95
|
+
# Delete a user
|
|
96
|
+
Delete a user
|
|
97
|
+
User.remove({'email': 'test@user.com'})
|
|
98
|
+
```
|
odbms-0.3.3/PKG-INFO
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: odbms
|
|
3
|
-
Version: 0.3.3
|
|
4
|
-
Summary: Database client for Mysql, MongoDB and Sqlite
|
|
5
|
-
Author: Amos Amissah
|
|
6
|
-
Author-email: theonlyamos@gmail.com
|
|
7
|
-
Project-URL: Source, https://github.com/theonlyamos/odbms/
|
|
8
|
-
Project-URL: Tracker, https://github.com/theonlyamos/odbms/issues
|
|
9
|
-
Keywords: python3 runit developer serverless architecture docker sqlite mysql mongodb
|
|
10
|
-
Classifier: Development Status :: 3 - Alpha
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: Topic :: Software Development :: Build Tools
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
License-File: LICENSE
|
|
22
|
-
Requires-Dist: python-dotenv
|
|
23
|
-
Requires-Dist: pymongo
|
|
24
|
-
Requires-Dist: psycopg2
|
|
25
|
-
|
|
26
|
-
# odbms
|
|
27
|
-
Python package for Managing Mysql, Mongodb and Sqlite instances
|
|
28
|
-
|
|
29
|
-
## Installation
|
|
30
|
-
|
|
31
|
-
```shell
|
|
32
|
-
pip install odbms
|
|
33
|
-
```
|
odbms-0.3.3/README.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: odbms
|
|
3
|
-
Version: 0.3.3
|
|
4
|
-
Summary: Database client for Mysql, MongoDB and Sqlite
|
|
5
|
-
Author: Amos Amissah
|
|
6
|
-
Author-email: theonlyamos@gmail.com
|
|
7
|
-
Project-URL: Source, https://github.com/theonlyamos/odbms/
|
|
8
|
-
Project-URL: Tracker, https://github.com/theonlyamos/odbms/issues
|
|
9
|
-
Keywords: python3 runit developer serverless architecture docker sqlite mysql mongodb
|
|
10
|
-
Classifier: Development Status :: 3 - Alpha
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: Topic :: Software Development :: Build Tools
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
License-File: LICENSE
|
|
22
|
-
Requires-Dist: python-dotenv
|
|
23
|
-
Requires-Dist: pymongo
|
|
24
|
-
Requires-Dist: psycopg2
|
|
25
|
-
|
|
26
|
-
# odbms
|
|
27
|
-
Python package for Managing Mysql, Mongodb and Sqlite instances
|
|
28
|
-
|
|
29
|
-
## Installation
|
|
30
|
-
|
|
31
|
-
```shell
|
|
32
|
-
pip install odbms
|
|
33
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|