orm-database 0.3.19__tar.gz → 0.3.21__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {orm_database-0.3.19 → orm_database-0.3.21}/PKG-INFO +23 -1
- {orm_database-0.3.19 → orm_database-0.3.21}/README.md +22 -0
- {orm_database-0.3.19 → orm_database-0.3.21}/orm_database/orm_database.py +21 -0
- {orm_database-0.3.19 → orm_database-0.3.21}/orm_database/orm_query.py +23 -0
- {orm_database-0.3.19 → orm_database-0.3.21}/orm_database.egg-info/PKG-INFO +23 -1
- {orm_database-0.3.19 → orm_database-0.3.21}/setup.py +1 -1
- {orm_database-0.3.19 → orm_database-0.3.21}/LICENSE +0 -0
- {orm_database-0.3.19 → orm_database-0.3.21}/orm_database/__init__.py +0 -0
- {orm_database-0.3.19 → orm_database-0.3.21}/orm_database.egg-info/SOURCES.txt +0 -0
- {orm_database-0.3.19 → orm_database-0.3.21}/orm_database.egg-info/dependency_links.txt +0 -0
- {orm_database-0.3.19 → orm_database-0.3.21}/orm_database.egg-info/requires.txt +0 -0
- {orm_database-0.3.19 → orm_database-0.3.21}/orm_database.egg-info/top_level.txt +0 -0
- {orm_database-0.3.19 → orm_database-0.3.21}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: orm_database
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.21
|
4
4
|
Summary: This module is written to launch your programs with any database you want in the shortest time
|
5
5
|
Home-page: https://github.com/sisrsis/orm-database
|
6
6
|
Author: SISRSIS
|
@@ -253,4 +253,26 @@ output
|
|
253
253
|
```
|
254
254
|
|
255
255
|
|
256
|
+
## edit delete postgres
|
257
|
+
```python
|
258
|
+
from orm_database import PostgreSQL
|
259
|
+
import asyncio
|
260
|
+
|
261
|
+
|
262
|
+
postgres = PostgreSQL(host="127.0.0.1",user="postgres",database="wallet",password="123412341234")
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
256
267
|
|
268
|
+
async def main():
|
269
|
+
|
270
|
+
await postgres.start()
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
await postgres.delete_one("pending_order",{"id":1})
|
275
|
+
|
276
|
+
await postgres.update_one("pending_order1",{"id":1},{"users":"sis"})
|
277
|
+
|
278
|
+
```
|
@@ -231,4 +231,26 @@ output
|
|
231
231
|
```
|
232
232
|
|
233
233
|
|
234
|
+
## edit delete postgres
|
235
|
+
```python
|
236
|
+
from orm_database import PostgreSQL
|
237
|
+
import asyncio
|
238
|
+
|
239
|
+
|
240
|
+
postgres = PostgreSQL(host="127.0.0.1",user="postgres",database="wallet",password="123412341234")
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
234
245
|
|
246
|
+
async def main():
|
247
|
+
|
248
|
+
await postgres.start()
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
await postgres.delete_one("pending_order",{"id":1})
|
253
|
+
|
254
|
+
await postgres.update_one("pending_order1",{"id":1},{"users":"sis"})
|
255
|
+
|
256
|
+
```
|
@@ -154,6 +154,27 @@ class PostgreSQL:
|
|
154
154
|
return None
|
155
155
|
|
156
156
|
|
157
|
+
async def delete_one(self,table:str,filed:dict):
|
158
|
+
query = query_delete_one(table=table,filed=filed)
|
159
|
+
try:
|
160
|
+
await self.db.execute(query)
|
161
|
+
return True
|
162
|
+
except:
|
163
|
+
return False
|
164
|
+
|
165
|
+
|
166
|
+
async def update_one(self,table:str,find:dict,value:dict):
|
167
|
+
query = query_update_one(table=table,find=find,value=value)
|
168
|
+
try:
|
169
|
+
await self.db.execute(query)
|
170
|
+
return True
|
171
|
+
except:
|
172
|
+
return False
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
157
178
|
class Mongodb:
|
158
179
|
def __init__(self, url, name):
|
159
180
|
self.url = url
|
@@ -102,4 +102,27 @@ def select_columns(table:str,filed:dict):
|
|
102
102
|
query = query + table + " WHERE "
|
103
103
|
fileds = list(filed.keys())
|
104
104
|
query = query + fileds[0]+"="+"%s"
|
105
|
+
return query
|
106
|
+
|
107
|
+
|
108
|
+
# DELETE FROM pending_order WHERE users='s1';
|
109
|
+
def query_delete_one(table:str,filed:dict):
|
110
|
+
query = f"DELETE FROM {table} WHERE"
|
111
|
+
key = filed.keys()
|
112
|
+
key = list(key)
|
113
|
+
key = key[0]
|
114
|
+
query = query + " " + str(key) + "="+ str(filed[key])
|
115
|
+
return query
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
def query_update_one(table:str,find:dict,value:dict):
|
120
|
+
query = f"UPDATE {table} SET"
|
121
|
+
key = find.keys()
|
122
|
+
key = list(key)
|
123
|
+
key = key[0]
|
124
|
+
key_v = value.keys()
|
125
|
+
key_v = list(key_v)
|
126
|
+
key_v = key_v[0]
|
127
|
+
query = query+ " " + str(key_v)+ "='" + str(value[key_v]) + "' " +"WHERE" + " " + str(key) + "="+ str(find[key])
|
105
128
|
return query
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: orm_database
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.21
|
4
4
|
Summary: This module is written to launch your programs with any database you want in the shortest time
|
5
5
|
Home-page: https://github.com/sisrsis/orm-database
|
6
6
|
Author: SISRSIS
|
@@ -253,4 +253,26 @@ output
|
|
253
253
|
```
|
254
254
|
|
255
255
|
|
256
|
+
## edit delete postgres
|
257
|
+
```python
|
258
|
+
from orm_database import PostgreSQL
|
259
|
+
import asyncio
|
260
|
+
|
261
|
+
|
262
|
+
postgres = PostgreSQL(host="127.0.0.1",user="postgres",database="wallet",password="123412341234")
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
256
267
|
|
268
|
+
async def main():
|
269
|
+
|
270
|
+
await postgres.start()
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
await postgres.delete_one("pending_order",{"id":1})
|
275
|
+
|
276
|
+
await postgres.update_one("pending_order1",{"id":1},{"users":"sis"})
|
277
|
+
|
278
|
+
```
|
@@ -6,7 +6,7 @@ long_description = (this_directory / "README.md").read_text()
|
|
6
6
|
|
7
7
|
setup(
|
8
8
|
name='orm_database',
|
9
|
-
version='0.3.
|
9
|
+
version='0.3.21',
|
10
10
|
description='This module is written to launch your programs with any database you want in the shortest time ',
|
11
11
|
license="MIT",
|
12
12
|
author='SISRSIS',
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|