orm-database 0.3.12__tar.gz → 0.3.13__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {orm_database-0.3.12 → orm_database-0.3.13}/PKG-INFO +1 -1
- {orm_database-0.3.12 → orm_database-0.3.13}/orm_database/orm_query.py +24 -31
- {orm_database-0.3.12 → orm_database-0.3.13}/orm_database.egg-info/PKG-INFO +1 -1
- {orm_database-0.3.12 → orm_database-0.3.13}/setup.py +1 -1
- {orm_database-0.3.12 → orm_database-0.3.13}/LICENSE +0 -0
- {orm_database-0.3.12 → orm_database-0.3.13}/README.md +0 -0
- {orm_database-0.3.12 → orm_database-0.3.13}/orm_database/__init__.py +0 -0
- {orm_database-0.3.12 → orm_database-0.3.13}/orm_database/orm_database.py +0 -0
- {orm_database-0.3.12 → orm_database-0.3.13}/orm_database.egg-info/SOURCES.txt +0 -0
- {orm_database-0.3.12 → orm_database-0.3.13}/orm_database.egg-info/dependency_links.txt +0 -0
- {orm_database-0.3.12 → orm_database-0.3.13}/orm_database.egg-info/requires.txt +0 -0
- {orm_database-0.3.12 → orm_database-0.3.13}/orm_database.egg-info/top_level.txt +0 -0
- {orm_database-0.3.12 → orm_database-0.3.13}/setup.cfg +0 -0
@@ -1,39 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
def query_baseModel_create_table(table,class_BaseModel):
|
4
2
|
query = f"CREATE TABLE {table} ("
|
5
3
|
result=class_BaseModel.model_json_schema()
|
4
|
+
type=""
|
6
5
|
for a in result['required']:
|
7
6
|
data = result['properties'][a]
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
case
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
case 'number':
|
32
|
-
types = 'float'
|
33
|
-
case 'string':
|
34
|
-
types = 'varchar'
|
35
|
-
uint = str(a)+" "+types +"("+str(data["varchar"])+")"
|
36
|
-
query = query + " " + uint + " ,"
|
7
|
+
if len(data.keys()) == 2:
|
8
|
+
match data["type"]:
|
9
|
+
case "string":
|
10
|
+
type = "varchar"
|
11
|
+
case "number":
|
12
|
+
type = "float"
|
13
|
+
case "integer":
|
14
|
+
type = "int"
|
15
|
+
case "boolean":
|
16
|
+
type = "bool"
|
17
|
+
query = query + a + " " + type + ","
|
18
|
+
else :
|
19
|
+
match data["type"]:
|
20
|
+
case "string":
|
21
|
+
type = f"varchar({data["varchar"]})"
|
22
|
+
case "number":
|
23
|
+
type = "float"
|
24
|
+
case "integer":
|
25
|
+
type = "int"
|
26
|
+
case "boolean":
|
27
|
+
type = "bool"
|
28
|
+
|
29
|
+
query = query + a + " " + type + ","
|
37
30
|
query = query[:-1]
|
38
31
|
query = query + ")"
|
39
32
|
return query
|
@@ -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.13',
|
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
|
File without changes
|
File without changes
|