MySQLX 2.2.8__tar.gz → 2.2.9__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.8
3
+ Version: 2.2.9
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
@@ -172,7 +172,7 @@ Transaction
172
172
 
173
173
  If you want to use ORM, may be you need SQLORMX: https://pypi.org/project/sqlormx
174
174
 
175
- If you want to operate PostgreSQL database, may be you need PgSqlx: https://pypi.org/project/pgsqlx
175
+ If you want to operate PostgreSQL database, may be you need PgSQLX: https://pypi.org/project/pgsqlx
176
176
 
177
177
  If you just wanted a simple sql executor, may be you need SQLExecX: https://pypi.org/project/sqlexecx
178
178
 
@@ -0,0 +1,2 @@
1
+ Jinja2>=2.7.0
2
+ sqlexecx>=2.1.9
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MySQLX
3
- Version: 2.2.8
3
+ Version: 2.2.9
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
@@ -172,7 +172,7 @@ Transaction
172
172
 
173
173
  If you want to use ORM, may be you need SQLORMX: https://pypi.org/project/sqlormx
174
174
 
175
- If you want to operate PostgreSQL database, may be you need PgSqlx: https://pypi.org/project/pgsqlx
175
+ If you want to operate PostgreSQL database, may be you need PgSQLX: https://pypi.org/project/pgsqlx
176
176
 
177
177
  If you just wanted a simple sql executor, may be you need SQLExecX: https://pypi.org/project/sqlexecx
178
178
 
@@ -158,7 +158,7 @@ Transaction
158
158
 
159
159
  If you want to use ORM, may be you need SQLORMX: https://pypi.org/project/sqlormx
160
160
 
161
- If you want to operate PostgreSQL database, may be you need PgSqlx: https://pypi.org/project/pgsqlx
161
+ If you want to operate PostgreSQL database, may be you need PgSQLX: https://pypi.org/project/pgsqlx
162
162
 
163
163
  If you just wanted a simple sql executor, may be you need SQLExecX: https://pypi.org/project/sqlexecx
164
164
 
@@ -1,3 +1,4 @@
1
+ import os
1
2
  import re
2
3
  from jinja2 import Template
3
4
  from functools import lru_cache
@@ -6,6 +7,9 @@ from .constant import DYNAMIC_REGEX, SQL_CACHE_SIZE
6
7
 
7
8
  from sqlexecx.sql_support import get_named_sql_args, is_mapping, get_mapping_sql_args, try_mapping, get_batch_args
8
9
 
10
+ sql_cache_size = int(os.getenv('SQL_CACHE_SIZE', SQL_CACHE_SIZE))
11
+ print(f'======== SQL_CACHE_SIZE: {sql_cache_size}')
12
+
9
13
 
10
14
  def simple_sql(sql: str, *args, **kwargs):
11
15
  return get_named_sql_args(sql, **kwargs) if kwargs else (sql, args)
@@ -23,12 +27,12 @@ def get_page_start(page_num: int, page_size: int):
23
27
  return (page_num - 1) * page_size
24
28
 
25
29
 
26
- @lru_cache(maxsize=SQL_CACHE_SIZE)
30
+ @lru_cache(maxsize=sql_cache_size)
27
31
  def is_dynamic_sql(sql: str):
28
32
  return re.search(DYNAMIC_REGEX, sql) is not None
29
33
 
30
34
 
31
- @lru_cache(maxsize=SQL_CACHE_SIZE)
35
+ @lru_cache(maxsize=sql_cache_size)
32
36
  def _get_sql_type(sql: str):
33
37
  """
34
38
  :return: 0: placeholder, 1: dynamic, 2: named mapping
@@ -19,9 +19,9 @@ setup(
19
19
  long_description_content_type='text/markdown',
20
20
  install_requires=[
21
21
  'Jinja2>=2.7.0',
22
- 'sqlexecx>=2.1.4',
22
+ 'sqlexecx>=2.1.9',
23
23
  ],
24
- version='2.2.8',
24
+ version='2.2.9',
25
25
  url='https://gitee.com/summry/mysqlx',
26
26
  author='summy',
27
27
  author_email='xiazhongbiao@126.com',
@@ -1,2 +0,0 @@
1
- Jinja2>=2.7.0
2
- sqlexecx>=2.1.4
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