MySQLX 2.2.7__tar.gz → 2.2.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MySQLX
3
- Version: 2.2.7
3
+ Version: 2.2.8
4
4
  Summary: A thread safe sql executor for MySQL like MyBatis with connection pool. It helps you automatically manage database connections and transactions.
5
5
  Home-page: https://gitee.com/summry/mysqlx
6
6
  Author: summy
@@ -134,6 +134,10 @@ Usage Sample
134
134
  # result:
135
135
  # [{'id': 3, 'name': 'zhangsan', 'age': 15}]
136
136
 
137
+ users = db.table('user').columns('id, name, age').where(name__eq='zhangsan').query()
138
+ # result:
139
+ # [{'id': 3, 'name': 'zhangsan', 'age': 15}]
140
+
137
141
  users = db.select('select id, name, age from user')
138
142
  # result:
139
143
  # (3, 'zhangsan', 15)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MySQLX
3
- Version: 2.2.7
3
+ Version: 2.2.8
4
4
  Summary: A thread safe sql executor for MySQL like MyBatis with connection pool. It helps you automatically manage database connections and transactions.
5
5
  Home-page: https://gitee.com/summry/mysqlx
6
6
  Author: summy
@@ -134,6 +134,10 @@ Usage Sample
134
134
  # result:
135
135
  # [{'id': 3, 'name': 'zhangsan', 'age': 15}]
136
136
 
137
+ users = db.table('user').columns('id, name, age').where(name__eq='zhangsan').query()
138
+ # result:
139
+ # [{'id': 3, 'name': 'zhangsan', 'age': 15}]
140
+
137
141
  users = db.select('select id, name, age from user')
138
142
  # result:
139
143
  # (3, 'zhangsan', 15)
@@ -120,6 +120,10 @@ Usage Sample
120
120
  # result:
121
121
  # [{'id': 3, 'name': 'zhangsan', 'age': 15}]
122
122
 
123
+ users = db.table('user').columns('id, name, age').where(name__eq='zhangsan').query()
124
+ # result:
125
+ # [{'id': 3, 'name': 'zhangsan', 'age': 15}]
126
+
123
127
  users = db.select('select id, name, age from user')
124
128
  # result:
125
129
  # (3, 'zhangsan', 15)
@@ -0,0 +1,42 @@
1
+ from . import dbx
2
+ from sqlexecx.sql_exec import SqlExec
3
+ from sqlexecx.page_exec import PageExec
4
+
5
+
6
+ class SqlIdExec(SqlExec):
7
+
8
+ def save(self, *args, **kwargs):
9
+ """
10
+ Insert data into table, return primary key.
11
+
12
+ :param args:
13
+ :return: Primary key
14
+ """
15
+ return self.exec.save(self.sql, *args, **kwargs)
16
+
17
+
18
+ def sql(sql_id: str):
19
+ """
20
+ Get a SqlIdExec instance
21
+
22
+ Examples
23
+ --------
24
+ >>> from mysqlx import dbx
25
+ >>> dbx.sql('user.select_all')
26
+ SqlIdExec()
27
+ """
28
+ assert sql_id, "Parameter 'sql_id' must not be none"
29
+ return SqlIdExec(dbx, sql_id)
30
+
31
+
32
+ def page(page_num: int, page_size: int):
33
+ """
34
+ Get a PageExec instance
35
+
36
+ Examples
37
+ --------
38
+ >>> from mysqlx import dbx
39
+ >>> dbx.page(1, 10)
40
+ PageExec()
41
+ """
42
+ return PageExec(dbx, page_num, page_size)
@@ -0,0 +1,30 @@
1
+ from . import db
2
+ from sqlexecx.sql_exec import SqlExec
3
+ from sqlexecx.page_exec import PageExec
4
+
5
+
6
+ def sql(sql: str):
7
+ """
8
+ Get a SqlExec instance
9
+
10
+ Examples
11
+ --------
12
+ >>> from mysqlx import db
13
+ >>> db.sql('SELECT id, name, age FROM person')
14
+ SqlExec()
15
+ """
16
+ assert sql, "Parameter 'sql' must not be none"
17
+ return SqlExec(db, sql)
18
+
19
+
20
+ def page(page_num: int, page_size: int):
21
+ """
22
+ Get a PageExec instance
23
+
24
+ Examples
25
+ --------
26
+ >>> from mysqlx import db
27
+ >>> db.page(1, 10)
28
+ PageExec()
29
+ """
30
+ return PageExec(db, page_num, page_size)
@@ -21,7 +21,7 @@ setup(
21
21
  'Jinja2>=2.7.0',
22
22
  'sqlexecx>=2.1.4',
23
23
  ],
24
- version='2.2.7',
24
+ version='2.2.8',
25
25
  url='https://gitee.com/summry/mysqlx',
26
26
  author='summy',
27
27
  author_email='xiazhongbiao@126.com',
@@ -1,25 +0,0 @@
1
- from . import dbx
2
- from sqlexecx.sql_exec import SqlExec as _SqlExec
3
- from sqlexecx.page_exec import PageExec
4
-
5
-
6
- class SqlExec(_SqlExec):
7
-
8
- def save(self, *args, **kwargs):
9
- """
10
- Insert data into table, return primary key.
11
-
12
- :param select_key: sql for select primary key
13
- :param args:
14
- :return: Primary key
15
- """
16
- return self.exec.save(self.sql, *args, **kwargs)
17
-
18
-
19
- def sql(sql: str) :
20
- assert sql, "Parameter 'sql' must not be none"
21
- return SqlExec(dbx, sql)
22
-
23
-
24
- def page(page_num: int, page_size: int) :
25
- return PageExec(dbx, page_num, page_size)
@@ -1,12 +0,0 @@
1
- from . import db
2
- from sqlexecx.sql_exec import SqlExec
3
- from sqlexecx.page_exec import PageExec
4
-
5
-
6
- def sql(sql: str):
7
- assert sql, "Parameter 'sql' must not be none"
8
- return SqlExec(db, sql)
9
-
10
-
11
- def page(page_num: int, page_size: int) :
12
- return PageExec(db, page_num, page_size)
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