lesscode-database 0.0.11__py3-none-any.whl → 0.0.12__py3-none-any.whl

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.
@@ -209,7 +209,7 @@ class Pool:
209
209
  mincached=conn_info.min_size, blocking=True, maxusage=conn_info.min_size,
210
210
  maxshared=conn_info.max_size, maxcached=conn_info.max_size,
211
211
  ping=1, maxconnections=conn_info.max_size, charset="utf8mb4", autocommit=True,
212
- read_timeout=30)
212
+ read_timeout=30,ursorclass=pymysql.cursors.DictCursor)
213
213
  return pool
214
214
 
215
215
  @staticmethod
@@ -135,3 +135,87 @@ class DsHelper:
135
135
  if i == num - 1:
136
136
  raise e
137
137
  return res
138
+
139
+
140
+ def exec_(self,sql_type:str,sql):
141
+ if sql_type not in ["all", "first", "delete", "update", "insert"]:
142
+ raise Exception(f"sql_type must be all,first,delete,update,insert")
143
+ if self.connect_info.db_type in ["mysql","doris","ocean_base","tidb"]:
144
+ if sql_type == "all":
145
+ with self.pool.dedicated_connection() as conn:
146
+ conn.ping(reconnect=True)
147
+ with conn.cursor() as cursor:
148
+ cursor.execute(sql)
149
+ rs = cursor.fetchall()
150
+ return rs
151
+ elif sql_type == "first":
152
+ with self.pool.dedicated_connection() as conn:
153
+ conn.ping(reconnect=True)
154
+ with conn.cursor() as cursor:
155
+ cursor.execute(sql)
156
+ rs = cursor.fetchone()
157
+ return rs
158
+ elif sql_type == "delete":
159
+ with self.pool.dedicated_connection() as conn:
160
+ conn.ping(reconnect=True)
161
+ with conn.cursor() as cursor:
162
+ rs = cursor.execute(sql)
163
+ return rs
164
+ elif sql_type == "update":
165
+ with self.pool.dedicated_connection() as conn:
166
+ conn.ping(reconnect=True)
167
+ with conn.cursor() as cursor:
168
+ rs = cursor.execute(sql)
169
+ return rs
170
+ else:
171
+ with self.pool.dedicated_connection() as conn:
172
+ conn.ping(reconnect=True)
173
+ with conn.cursor() as cursor:
174
+ rs= cursor.execute(sql)
175
+ return rs
176
+
177
+
178
+ elif self.connect_info.db_type == "neo4j":
179
+ return self.make_neo4j_session()
180
+ elif self.connect_info.db_type == "esapi":
181
+ return self.esapi
182
+ elif self.connect_info.db_type == "es":
183
+ return self.esapi
184
+ else:
185
+ return self.pool
186
+
187
+ async def async_exec_(self,sql_type:str,sql):
188
+ if sql_type not in ["all", "first", "delete", "update", "insert"]:
189
+ raise Exception(f"sql_type must be all,first,delete,update,insert")
190
+ if self.connect_info.db_type in ["mysql","doris","ocean_base","tidb"]:
191
+ if sql_type == "all":
192
+ async with self.pool.acquire() as conn:
193
+ async with conn.cursor() as cursor:
194
+ await cursor.execute(sql)
195
+ rs = await cursor.fetchall()
196
+ return rs
197
+ elif sql_type == "first":
198
+ async with self.pool.acquire() as conn:
199
+ async with conn.cursor() as cursor:
200
+ await cursor.execute(sql)
201
+ rs = await cursor.fetchone()
202
+ return rs
203
+ elif sql_type == "delete":
204
+ async with self.pool.acquire() as conn:
205
+ async with conn.cursor() as cursor:
206
+ rs = await cursor.execute(sql)
207
+ return rs
208
+ elif sql_type == "update":
209
+ async with self.pool.acquire() as conn:
210
+ async with conn.cursor() as cursor:
211
+ rs = await cursor.execute(sql)
212
+ return rs
213
+ else:
214
+ async with self.pool.acquire() as conn:
215
+ async with conn.cursor() as cursor:
216
+ rs= await cursor.execute(sql)
217
+ return rs
218
+ elif self.connect_info.db_type == "neo4j":
219
+ return self.async_make_neo4
220
+ else:
221
+ return self.pool
File without changes
@@ -0,0 +1,299 @@
1
+ from typing import Union
2
+
3
+ from lesscode_database.ds_helper import DsHelper
4
+ from lesscode_database.orm.orm_func import OrmFunc
5
+ from lesscode_database.orm.orm_model import BaseModel
6
+ from lesscode_database.orm.orm_typing import BaseColumnType, BaseColumnTypeAlias, SubSelect, Int, TinyInt, SmallInt, \
7
+ MediumInt
8
+
9
+
10
+ class Select:
11
+ def __init__(self, *args):
12
+ self._tables = []
13
+ self._column_tables = []
14
+ self._columns = []
15
+ self._origin_column_map = dict()
16
+ self._joins = []
17
+ self._conditions = []
18
+ self._group_by = []
19
+ self._having = []
20
+ self._order_by = []
21
+ self._limit = []
22
+ self._connect_name = None
23
+ for arg in args:
24
+ if isinstance(arg, BaseColumnType):
25
+ if hasattr(arg, "owner"):
26
+ if not self._connect_name:
27
+ self._connect_name = arg.owner.__bind_key__ if hasattr(arg.owner, '__bind_key__') else None
28
+ _table_name = arg.owner.__table_name__ if hasattr(arg.owner, "__table_name__") else ""
29
+ if _table_name and _table_name not in self._tables:
30
+ self._column_tables.append(_table_name)
31
+ self._columns.append(arg._name)
32
+ self._origin_column_map = {arg._name: arg}
33
+
34
+ elif isinstance(arg, BaseColumnTypeAlias):
35
+ _ct = arg.column_type
36
+ if isinstance(_ct, BaseColumnType):
37
+ if hasattr(_ct, "owner"):
38
+ _table_name = _ct.owner.__table_name__ if hasattr(_ct, "__table_name__") else ""
39
+ if _table_name and _table_name not in self._column_tables:
40
+ self._column_tables.append(_table_name)
41
+ if not self._connect_name:
42
+ self._connect_name = _ct.owner.__bind_key__ if hasattr(_ct.owner, '__bind_key__') else None
43
+ self._origin_column_map = {arg.alias: arg}
44
+ self._columns.append(arg._name)
45
+
46
+ elif isinstance(arg, OrmFunc):
47
+ self._columns.append(str(arg))
48
+ self._origin_column_map = {arg._name: arg}
49
+
50
+ elif issubclass(arg, BaseModel):
51
+ if hasattr(arg, "__table_name__"):
52
+ _table_name = arg.__table_name__
53
+ if _table_name and _table_name not in self._column_tables:
54
+ self._column_tables.append(_table_name)
55
+ if not self._connect_name:
56
+ if hasattr(arg, "__bind_key__"):
57
+ self._connect_name = arg.__bind_key__
58
+ _attrs = vars(arg)
59
+ for attr in _attrs:
60
+ if hasattr(arg, attr):
61
+ if isinstance(getattr(arg, attr), BaseColumnType):
62
+ self._origin_column_map = {getattr(arg, attr)._name: getattr(arg, attr)}
63
+ self._columns.append(getattr(arg, attr)._name)
64
+ else:
65
+ raise TypeError("args must be str or BaseColumnType")
66
+
67
+ def select_from(self, model):
68
+ if isinstance(model, list):
69
+ for _model in model:
70
+ if issubclass(_model, BaseModel):
71
+ if hasattr(_model, "__table_name__"):
72
+ if _model.__table_name__ not in self._tables:
73
+ self._tables.append(_model.__table_name__)
74
+ if not self._connect_name:
75
+ if hasattr(_model, "__bind_key__"):
76
+ self._connect_name = _model.__bind_key__
77
+ else:
78
+ raise TypeError("model must be BaseModel")
79
+ elif issubclass(model, BaseModel):
80
+ if hasattr(model, "__table_name__"):
81
+ if model.__table_name__ not in self._tables:
82
+ self._tables.append(model.__table_name__)
83
+ if not self._connect_name:
84
+ if hasattr(model, "__bind_key__"):
85
+ self._connect_name = model.__bind_key__
86
+ else:
87
+ raise TypeError("model must be BaseModel")
88
+ return self
89
+
90
+ def join(self, model, relation_list: list, how="left join"):
91
+ if not issubclass(model, BaseModel):
92
+ raise TypeError("model must be BaseModel")
93
+ self._joins.append(f"{how} {model.__table_name__} ON {' and '.join(relation_list)}")
94
+ return self
95
+
96
+ def where(self, *args):
97
+ self._conditions = [arg for arg in args]
98
+ return self
99
+
100
+ def group_by(self, *args):
101
+ self._group_by = [arg for arg in args]
102
+ return self
103
+
104
+ def having(self, *args):
105
+ self._having = [arg for arg in args]
106
+ return self
107
+
108
+ def order_by(self, *args):
109
+ self._order_by = [arg for arg in args]
110
+ return self
111
+
112
+ def limit(self, offset=0, num=10):
113
+ self._limit = [offset, num]
114
+ return self
115
+
116
+ def sub(self, alias: str = None):
117
+ return SubSelect(sql=self._sql(), alias=alias)
118
+
119
+ def _sql(self):
120
+ sql = f"select {','.join(self._columns)}"
121
+ if self._tables:
122
+ sql += f" from {' , '.join(self._tables)}"
123
+ else:
124
+ if self._column_tables:
125
+ sql += f" from {' , '.join(self._column_tables)}"
126
+ if self._joins:
127
+ sql += " " + " ".join(self._joins)
128
+ if self._conditions:
129
+ sql += " where " + " and ".join(self._conditions)
130
+
131
+ if self._group_by:
132
+ sql += " group by " + " , ".join(self._group_by)
133
+ if self._having:
134
+ sql += " having " + " and ".join(self._having)
135
+ if self._order_by:
136
+ sql += " order by " + " , ".join(self._order_by)
137
+ if self._limit:
138
+ sql += f" limit {self._limit[0]},{self._limit[1]}"
139
+ return sql
140
+
141
+ def __repr__(self):
142
+ return self._sql()
143
+
144
+ def __str__(self) -> str:
145
+ return self.__repr__()
146
+
147
+
148
+ class Update:
149
+ def __init__(self, model):
150
+ self._table = ""
151
+ self._conditions = []
152
+ self._connect_name = ""
153
+ self.update_values = {}
154
+ if issubclass(model, BaseModel):
155
+ self._table = model.__table_name__
156
+ self._connect_name = model.__bind_key__
157
+ else:
158
+ raise TypeError("model must be BaseModel")
159
+
160
+ def where(self, *args):
161
+ self._conditions = [arg for arg in args]
162
+ return self
163
+
164
+ def values(self, **kwargs):
165
+ self.update_values = kwargs
166
+
167
+ def _sql(self):
168
+ sql = f"update {self._table} set "
169
+ update_column_sql = ','.join([f"{k}={v}" for k, v in self.update_values.items()])
170
+ sql += update_column_sql
171
+ if self._conditions:
172
+ sql += " where " + " and ".join(self._conditions)
173
+ return sql
174
+
175
+
176
+ class Delete:
177
+ def __init__(self, model):
178
+ self._table = ""
179
+ self._conditions = []
180
+ self._connect_name = ""
181
+ self.update_values = {}
182
+ if issubclass(model, BaseModel):
183
+ self._table = model.__table_name__
184
+ self._connect_name = model.__bind_key__
185
+ else:
186
+ raise TypeError("model must be BaseModel")
187
+
188
+ def where(self, *args):
189
+ self._conditions = [arg for arg in args]
190
+ return self
191
+
192
+ def _sql(self):
193
+ sql = f"delete from {self._table}"
194
+ if self._conditions:
195
+ sql += " where " + " and ".join(self._conditions)
196
+ return sql
197
+
198
+
199
+ class Insert:
200
+ def __init__(self, model):
201
+ self._table = ""
202
+ self._connect_name = ""
203
+ self.insert_values = {}
204
+ if issubclass(model, BaseModel):
205
+ self._table = model.__table_name__
206
+ self._connect_name = model.__bind_key__
207
+ else:
208
+ raise TypeError("model must be BaseModel")
209
+
210
+ def values(self, data: Union[list, dict]):
211
+ self.insert_values = data
212
+
213
+ def _sql(self):
214
+ sql = f"insert into {self._table} "
215
+ insert_column_list = []
216
+ insert_value_list = []
217
+ if isinstance(self.insert_values, list):
218
+ one = self.insert_values[0]
219
+ insert_column_list = list(one.keys())
220
+ for _ in self.insert_values:
221
+ _insert_value_list = []
222
+ for k in insert_column_list:
223
+ if _[k] is None:
224
+ _insert_value_list.append("null")
225
+ else:
226
+ _insert_value_list.append(_[k])
227
+ insert_value_list.append(f"""({','.join(_insert_value_list)})""")
228
+ else:
229
+ _insert_value_list = []
230
+ for k, v in self.insert_values.items():
231
+ if v is None:
232
+ insert_column_list.append(k)
233
+ _insert_value_list.append("null")
234
+ else:
235
+ insert_column_list.append(k)
236
+ _insert_value_list.append(v)
237
+ insert_value_list.append(f"""({','.join(_insert_value_list)})""")
238
+ sql += f"({','.join(insert_column_list)}) values ({','.join(insert_value_list)})"
239
+ return sql
240
+
241
+
242
+ class Exec:
243
+ __connect_name__ = None
244
+
245
+ def __init__(self, connect_name: str = None):
246
+ self.__connect_name__ = connect_name or self.__connect_name__
247
+ self._sql = ""
248
+ self._result = None
249
+ self.sql_type =""
250
+
251
+ def execute(self, sql_object: Union[Select, Update, Delete, Insert]):
252
+ if not self.__connect_name__:
253
+ self.__connect_name__ = sql_object._connect_name
254
+ self._sql = sql_object._sql()
255
+ if isinstance(sql_object, Select):
256
+ return self
257
+ else:
258
+ return self
259
+
260
+ def all(self):
261
+ self.sql_type = "all"
262
+ self._result = DsHelper(self.__connect_name__).exec_(self.sql_type, self._sql)
263
+ return self._result
264
+
265
+ def first(self):
266
+ self.sql_type = "first"
267
+ self._result = DsHelper(self.__connect_name__).exec_(self.sql_type, self._sql)
268
+ return self._result
269
+
270
+ def update(self):
271
+ self.sql_type = "update"
272
+ self._result = DsHelper(self.__connect_name__).exec_(self.sql_type, self._sql)
273
+ return self._result
274
+
275
+ def delete(self):
276
+ self.sql_type = "delete"
277
+ self._result = DsHelper(self.__connect_name__).exec_(self.sql_type, self._sql)
278
+ return self._result
279
+
280
+ def insert(self):
281
+ self.sql_type = "insert"
282
+ self._result = DsHelper(self.__connect_name__).exec_(self.sql_type, self._sql)
283
+ return self._result
284
+
285
+
286
+ class TestModel(BaseModel):
287
+ __table_name__ = 'test_table'
288
+ __table_args__ = {'comment': '测试表'}
289
+ __bind_key__ = 'test_db'
290
+ id = Int('id', int, primary_key=True, autoincrement=True)
291
+ name = TinyInt('name', int)
292
+ age = SmallInt('age', int)
293
+ height = MediumInt('height', int)
294
+
295
+
296
+ a = Select(TestModel.id.alias("a"))
297
+ b = a.join(TestModel, [TestModel.id == TestModel.id]).where(TestModel.id == 1)
298
+
299
+ print(Exec().execute(b))
@@ -0,0 +1,45 @@
1
+ from typing import Union
2
+
3
+ from lesscode_database.orm.orm_typing import BaseColumnType
4
+
5
+
6
+ class OrmFunc:
7
+ def __init__(self, func_name: str, alias: str = None, **kwargs):
8
+ self.func_name = func_name
9
+ self.alias = alias
10
+ self.kwargs = kwargs or dict()
11
+
12
+ def _name(self):
13
+ return self.alias or str(self)
14
+
15
+ def __repr__(self):
16
+ if self.func_name in ["sum", "argv", "min", "max"]:
17
+ column = self.kwargs.get("column")
18
+ if column is None:
19
+ return f"{self.func_name}()"
20
+ else:
21
+ if isinstance(column, BaseColumnType):
22
+ return f"{self.func_name}({column._name}) as {self.alias}" if self.alias else f"{self.func_name}({column._name})"
23
+ else:
24
+ return f"{self.func_name}({repr(column)}) as {self.alias}" if self.alias else f"{self.func_name}({repr(column)})"
25
+ else:
26
+ return f"{self.func_name}({self.kwargs})"
27
+
28
+ def __str__(self):
29
+ return self.__repr__()
30
+
31
+
32
+ def func_sum(column: Union[BaseColumnType, int, float], alias=None):
33
+ return OrmFunc(func_name="sum", column=column, alias=alias)
34
+
35
+
36
+ def func_min(column: Union[BaseColumnType, int, float], alias=None):
37
+ return OrmFunc(func_name="min", column=column, alias=alias)
38
+
39
+
40
+ def func_max(column: Union[BaseColumnType, int, float], alias=None):
41
+ return OrmFunc(func_name="max", column=column, alias=alias)
42
+
43
+
44
+ def func_argv(column: Union[BaseColumnType, int, float], alias=None):
45
+ return OrmFunc(func_name="argv", column=column, alias=alias)
@@ -0,0 +1,21 @@
1
+ from lesscode_database.orm.orm_typing import BaseColumnType
2
+
3
+
4
+ class Meta(type):
5
+ def __new__(cls, name, bases, namespace):
6
+ for attr_name, attr_value in namespace.items():
7
+ if isinstance(attr_value, BaseColumnType):
8
+ attr_value.name = attr_name
9
+ attr_value.owner = None
10
+ new_cls = super().__new__(cls, name, bases, namespace)
11
+ for attr_value in namespace.values():
12
+ if isinstance(attr_value, BaseColumnType):
13
+ attr_value.owner = new_cls
14
+ attr_value.connect_name = new_cls.__bind_key__ if hasattr(new_cls, '__bind_key__') else None
15
+ return new_cls
16
+
17
+
18
+ class BaseModel(metaclass=Meta):
19
+ __table_name__ = 'base'
20
+ __table_args__ = {}
21
+ __bind_key__ = 'default'
@@ -0,0 +1,412 @@
1
+ import datetime
2
+ import time
3
+ from typing import Optional, Union, Any
4
+ from decimal import Decimal as _Decimal
5
+
6
+
7
+ class SubSelect:
8
+ def __init__(self, sql: str, alias: str):
9
+ self.sql = sql
10
+ self.alias = alias
11
+
12
+
13
+ class BaseColumnType:
14
+
15
+ def __init__(self, name: Optional[str], type_: Optional[Any],
16
+ default: Optional[Any] = None, index: Optional[bool] = None,
17
+ unique: Optional[bool] = None, nullable: Optional[bool] = True,
18
+ primary_key: Optional[bool] = False,
19
+ alias: Optional[str] = None,
20
+ is_symbol: Optional[bool] = False, symbol="`",
21
+ comment=""):
22
+ super(BaseColumnType, self).__init__()
23
+ self.name = name or self.__class__.__name__.lower()
24
+ self.name = f"{symbol}{self.name}{symbol}" if is_symbol else self.name
25
+ self.alias = alias or self.name
26
+ self.type_ = type_
27
+ self.default = default
28
+ self.index = index
29
+ self.unique = unique
30
+ self.nullable = nullable
31
+ self.primary_key = primary_key
32
+ self.comment = comment
33
+
34
+ def _check_value(self, value):
35
+ if not isinstance(value, self.type_):
36
+ raise Exception(f"{value} is not {self.type_} type")
37
+
38
+ def __eq__(self, other):
39
+ # 返回格式化的字符串
40
+ if not issubclass(other.__class__, BaseColumnType):
41
+ return f"{self._name}={other}"
42
+ else:
43
+ return f"{self._name}={other._name}"
44
+
45
+ def __ge__(self, other):
46
+ # 返回格式化的字符串
47
+ return f"{self._name}>={other._name}"
48
+
49
+ def __gt__(self, other):
50
+ # 返回格式化的字符串
51
+ return f"{self._name}>{other._name}"
52
+
53
+ def __le__(self, other):
54
+ # 返回格式化的字符串
55
+ return f"{self._name}<={other._name}"
56
+
57
+ def __lt__(self, other):
58
+ # 返回格式化的字符串
59
+ return f"{self._name}<{other._name}"
60
+
61
+ def __ne__(self, other):
62
+ # 返回格式化的字符串
63
+ return f"{self._name}!={other._name}"
64
+
65
+ @property
66
+ def _name(self):
67
+ _table_name = self.owner.__table_name__ if hasattr(self, "owner") else ""
68
+ return f"{_table_name}.{self.name}"
69
+
70
+ def in_(self, value: Union[list, tuple, SubSelect]):
71
+ if isinstance(value, SubSelect):
72
+ return f"{self._name} in ({value.sql})"
73
+ else:
74
+ return f"{self._name} in {repr(value)}"
75
+
76
+ def not_in(self, value: Union[list, tuple, SubSelect]):
77
+ if isinstance(value, SubSelect):
78
+ return f"{self._name} not in ({value.sql})"
79
+ else:
80
+ return f"{self._name} not in {repr(value)}"
81
+
82
+ def like(self, value: str):
83
+ return f"{self._name} like {repr(value)}"
84
+
85
+ def not_like(self, value: str):
86
+ return f"{self._name} not like {repr(value)}"
87
+
88
+ def is_null(self, value="null"):
89
+ return f"{self._name} is {value}"
90
+
91
+ def is_not_null(self, value="null"):
92
+ return f"{self._name} is not {value}"
93
+
94
+ def desc(self):
95
+ return f"{self._name} desc"
96
+
97
+ def asc(self):
98
+ return f"{self._name} asc"
99
+
100
+ def alias(self, name):
101
+ self.alias = name
102
+
103
+
104
+ class BaseColumnTypeAlias:
105
+ def __init__(self, column_type, alias):
106
+ self.column_type = column_type
107
+ self.alias = alias
108
+
109
+ @property
110
+ def _name(self):
111
+ return f"{self.column_type._name} as {self.alias}"
112
+
113
+
114
+ class TinyInt(BaseColumnType):
115
+
116
+ def __init__(self, name: Optional[str], type_: Optional[Any] = int,
117
+ default: Optional[Any] = None,
118
+ nullable: Optional[bool] = True,
119
+ comment=""):
120
+ if not issubclass(type_, int):
121
+ raise Exception("type_ must be int")
122
+ super().__init__(name=name, type_=type_, default=default, nullable=nullable,
123
+ comment=comment)
124
+
125
+
126
+ class SmallInt(BaseColumnType):
127
+
128
+ def __init__(self, name: Optional[str], type_: Optional[Any] = int,
129
+ default: Optional[Any] = None, index: Optional[bool] = None,
130
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
131
+ comment=""):
132
+ if not issubclass(type_, int):
133
+ raise Exception("type_ must be int")
134
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
135
+ primary_key=primary_key, comment=comment)
136
+
137
+
138
+ class MediumInt(BaseColumnType):
139
+
140
+ def __init__(self, name: Optional[str], type_: Optional[Any] = int,
141
+ default: Optional[Any] = None, index: Optional[bool] = None,
142
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
143
+ comment=""):
144
+ if not issubclass(type_, int):
145
+ raise Exception("type_ must be int")
146
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
147
+ primary_key=primary_key, comment=comment)
148
+
149
+
150
+ class Int(BaseColumnType):
151
+
152
+ def __init__(self, name: Optional[str], type_: Optional[Any] = int,
153
+ default: Optional[Any] = None, index: Optional[bool] = None,
154
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
155
+ comment="", autoincrement: bool = False):
156
+ if not issubclass(type_, int):
157
+ raise Exception("type_ must be int")
158
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
159
+ primary_key=primary_key, comment=comment)
160
+ self.autoincrement = autoincrement
161
+
162
+
163
+ class BigInt(BaseColumnType):
164
+ def __init__(self, name: Optional[str], type_: Optional[Any] = int,
165
+ default: Optional[Any] = None, index: Optional[bool] = None,
166
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
167
+ comment="", autoincrement: bool = False):
168
+ if not issubclass(type_, int):
169
+ raise Exception("type_ must be int")
170
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
171
+ primary_key=primary_key, comment=comment)
172
+ self.autoincrement = autoincrement
173
+
174
+
175
+ class Decimal(BaseColumnType):
176
+ def __init__(self, name: Optional[str], type_: Optional[Any] = _Decimal,
177
+ precision: int = 10, scale: int = 2,
178
+ default: Optional[Any] = None, index: Optional[bool] = None,
179
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
180
+ comment=""):
181
+ if not issubclass(type_, _Decimal):
182
+ raise Exception("type_ must be decimal")
183
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
184
+ primary_key=primary_key, comment=comment)
185
+ self.precision = precision
186
+ self.scale = scale
187
+
188
+
189
+ class Float(Decimal):
190
+ def __init__(self, name: Optional[str], type_: Optional[Any] = float,
191
+ precision: int = 10, scale: int = 2,
192
+ default: Optional[Any] = None, index: Optional[bool] = None,
193
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
194
+ comment=""):
195
+ if not issubclass(type_, int):
196
+ raise Exception("type_ must be float")
197
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
198
+ primary_key=primary_key, comment=comment)
199
+ self.precision = precision
200
+ self.scale = scale
201
+
202
+
203
+ class Double(Decimal):
204
+ def __init__(self, name: Optional[str], type_: Optional[Any] = float,
205
+ precision: int = 10, scale: int = 2,
206
+ default: Optional[Any] = None, index: Optional[bool] = None,
207
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
208
+ comment=""):
209
+ if not issubclass(type_, int):
210
+ raise Exception("type_ must be float")
211
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
212
+ primary_key=primary_key, comment=comment)
213
+ self.precision = precision
214
+ self.scale = scale
215
+
216
+
217
+ class Numeric(Decimal):
218
+ def __init__(self, name: Optional[str], type_: Optional[Any] = _Decimal,
219
+ precision: int = 10, scale: int = 2,
220
+ default: Optional[Any] = None, index: Optional[bool] = None,
221
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
222
+ comment=""):
223
+ if not issubclass(type_, _Decimal):
224
+ raise Exception("type_ must be decimal")
225
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
226
+ primary_key=primary_key, comment=comment)
227
+ self.precision = precision
228
+ self.scale = scale
229
+
230
+
231
+ class Real(Decimal):
232
+ def __init__(self, name: Optional[str], type_: Optional[Any] = float,
233
+ precision: int = 10, scale: int = 2,
234
+ default: Optional[Any] = None, index: Optional[bool] = None,
235
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
236
+ comment=""):
237
+ if not issubclass(type_, int):
238
+ raise Exception("type_ must be float")
239
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
240
+ primary_key=primary_key, comment=comment)
241
+ self.precision = precision
242
+ self.scale = scale
243
+
244
+
245
+ class Date(BaseColumnType):
246
+ def __init__(self, name: Optional[str], type_: Optional[Any] = datetime.date,
247
+ default: Optional[Any] = None, index: Optional[bool] = None,
248
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
249
+ comment=""):
250
+ if not issubclass(type_, datetime.date):
251
+ raise Exception("type_ must be Date")
252
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
253
+ primary_key=primary_key, comment=comment)
254
+
255
+
256
+ class DateTime(BaseColumnType):
257
+ def __init__(self, name: Optional[str], type_: Optional[Any] = datetime.datetime,
258
+ default: Optional[Any] = None, index: Optional[bool] = None,
259
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
260
+ comment=""):
261
+ if not issubclass(type_, datetime.datetime):
262
+ raise Exception("type_ must be DateTime")
263
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
264
+ primary_key=primary_key, comment=comment)
265
+
266
+
267
+ class TimeStamp(BaseColumnType):
268
+ def __init__(self, name: Optional[str], type_: Optional[Any] = datetime.datetime,
269
+ default: Optional[Any] = None, index: Optional[bool] = None,
270
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
271
+ comment=""):
272
+ if not issubclass(type_, datetime.datetime):
273
+ raise Exception("type_ must be TimeStamp")
274
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
275
+ primary_key=primary_key, comment=comment)
276
+
277
+
278
+ class Time(BaseColumnType):
279
+ def __init__(self, name: Optional[str], type_: Optional[Any] = datetime.time,
280
+ default: Optional[Any] = None, index: Optional[bool] = None,
281
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
282
+ comment=""):
283
+ if not issubclass(type_, datetime.time):
284
+ raise Exception("type_ must be Time")
285
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
286
+ primary_key=primary_key, comment=comment)
287
+
288
+
289
+ class Year(BaseColumnType):
290
+ def __init__(self, name: Optional[str], type_: Optional[Any] = int,
291
+ default: Optional[Any] = None, index: Optional[bool] = None,
292
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
293
+ comment=""):
294
+ if not issubclass(type_, int):
295
+ raise Exception("type_ must be Year")
296
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
297
+ primary_key=primary_key, comment=comment)
298
+
299
+
300
+ class Char(BaseColumnType):
301
+ def __init__(self, name: Optional[str], type_: Optional[Any] = str,
302
+ default: Optional[Any] = None, index: Optional[bool] = None,
303
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
304
+ comment=""):
305
+ if not issubclass(type_, str):
306
+ raise Exception("type_ must be Char")
307
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
308
+ primary_key=primary_key, comment=comment)
309
+
310
+
311
+ class Text(BaseColumnType):
312
+ def __init__(self, name: Optional[str], type_: Optional[Any] = str,
313
+ default: Optional[Any] = None, index: Optional[bool] = None,
314
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
315
+ comment=""):
316
+ if not issubclass(type_, str):
317
+ raise Exception("type_ must be Text")
318
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
319
+ primary_key=primary_key, comment=comment)
320
+
321
+
322
+ class Varchar(BaseColumnType):
323
+ def __init__(self, name: Optional[str], type_: Optional[Any] = str,
324
+ default: Optional[Any] = None, index: Optional[bool] = None,
325
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
326
+ comment=""):
327
+ if not issubclass(type_, str):
328
+ raise Exception("type_ must be Text")
329
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
330
+ primary_key=primary_key, comment=comment)
331
+
332
+
333
+ class Binary(BaseColumnType):
334
+ def __init__(self, name: Optional[str], type_: Optional[Any] = bytes,
335
+ default: Optional[Any] = None, index: Optional[bool] = None,
336
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
337
+ comment=""):
338
+ if not issubclass(type_, bytes):
339
+ raise Exception("type_ must be Binary")
340
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
341
+ primary_key=primary_key, comment=comment)
342
+
343
+
344
+ class Varbinary(BaseColumnType):
345
+ def __init__(self, name: Optional[str], type_: Optional[Any] = bytes,
346
+ default: Optional[Any] = None, index: Optional[bool] = None,
347
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
348
+ comment=""):
349
+ if not issubclass(type_, bytes):
350
+ raise Exception("type_ must be Varbinary")
351
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
352
+ primary_key=primary_key, comment=comment)
353
+
354
+
355
+ class Bolb(BaseColumnType):
356
+ def __init__(self, name: Optional[str], type_: Optional[Any] = bytes,
357
+ default: Optional[Any] = None, index: Optional[bool] = None,
358
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
359
+ comment=""):
360
+ if not issubclass(type_, bytes):
361
+ raise Exception("type_ must be Bolb")
362
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
363
+ primary_key=primary_key, comment=comment)
364
+
365
+
366
+ class Boolean(BaseColumnType):
367
+ def __init__(self, name: Optional[str], type_: Optional[Any] = bool,
368
+ default: Optional[Any] = None, index: Optional[bool] = None,
369
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
370
+ comment=""):
371
+ if not issubclass(type_, bool):
372
+ raise Exception("type_ must be Boolean")
373
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
374
+ primary_key=primary_key, comment=comment)
375
+
376
+
377
+ class Bool(BaseColumnType):
378
+ def __init__(self, name: Optional[str], type_: Optional[Any] = bool,
379
+ default: Optional[Any] = None, index: Optional[bool] = None,
380
+ unique: Optional[bool] = None, nullable: Optional[bool] = True, primary_key: Optional[bool] = False,
381
+ comment=""):
382
+ if not issubclass(type_, bool):
383
+ raise Exception("type_ must be Boolean")
384
+ super().__init__(name=name, type_=type_, default=default, index=index, unique=unique, nullable=nullable,
385
+ primary_key=primary_key, comment=comment)
386
+
387
+
388
+ class ResultColumnType:
389
+ def __init__(self, name: str = None, type_: Any = None, column: BaseColumnType = None, alias: str = None,
390
+ value: Any = None):
391
+ self.name = name or alias or column.name
392
+ self.type_ = type_ or column.type_
393
+ self.column = column
394
+ self.alias = alias
395
+ self.value = value
396
+
397
+
398
+ class ResultRow:
399
+ def __init__(self, **kwargs):
400
+ for k, v in kwargs.items():
401
+ setattr(self, k, v)
402
+
403
+
404
+ class Result:
405
+ def __init__(self, rows: list):
406
+ self.rows = rows
407
+
408
+ def to(self):
409
+ result = []
410
+ for row in self.rows:
411
+ _d = vars(row)
412
+ result.append(_d)
@@ -1,15 +1,19 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lesscode-database
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: lesscode_database是数据库连接工具包
5
- Author: navysummer
6
- Author-email: navysummer@yeah.net
7
- Platform: python
8
- Classifier: Programming Language :: Python :: 3
5
+ Author-email: navysummer <navysummer@yeah.net>
6
+ License: MIT License
7
+
8
+ Copyright (c) [year] [fullname]
9
+
10
+ Permission is hereby granted...
11
+ License-File: LICENSE
12
+ Classifier: License :: OSI Approved :: MIT License
9
13
  Classifier: Operating System :: OS Independent
10
- Requires-Python: >=3.6
14
+ Classifier: Programming Language :: Python :: 3
15
+ Requires-Python: >=3.7
11
16
  Description-Content-Type: text/markdown
12
- License-File: LICENSE
13
17
 
14
18
  # lesscode_database
15
19
 
@@ -0,0 +1,17 @@
1
+ lesscode_database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ lesscode_database/connect_pool.py,sha256=7mj3CRFvyGeE4ymPXRYJOzRX7otbknaRRhB74yJyZDY,48182
3
+ lesscode_database/connection_info.py,sha256=HMlA-hA0LE7jGUS8crZAgrBMB-o6B9mxrWYEywgqXHg,1307
4
+ lesscode_database/db_options.py,sha256=Z8Iy3pqDYW5YVVfvoFSsAYecK9LfiwRasYc3fzqIBt8,1928
5
+ lesscode_database/db_request.py,sha256=siZGXIdPuTlY4NwVLnU8098bVM_6jgQzSzeO4BzkDrA,4832
6
+ lesscode_database/ds_helper.py,sha256=XfXkcBfRgrv0rojl_EtdWrIHNeCdZYfoD75ZJOu6tQg,8568
7
+ lesscode_database/dynamic_import_package.py,sha256=J8hgGRHe6KrprOgOq-xbKHVAYHSjUBcNyTaSPvBmvIk,164
8
+ lesscode_database/mongo_base_model.py,sha256=cKHNmi5GJBGRxCtqsggEcrzIZK7__Z_4cVaIHxmqZsc,6406
9
+ lesscode_database/orm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ lesscode_database/orm/orm_exec.py,sha256=B4gwULU2kbXeIhwX3HTmAPw9_rO3Z7xMGj3xXV68xiM,10885
11
+ lesscode_database/orm/orm_func.py,sha256=-ZKO8XQQM1mUz5el-j8FkApjhI50zomg-FNfQVzwc5U,1570
12
+ lesscode_database/orm/orm_model.py,sha256=yMt9rE9e2gYqE8Fynzk-LeaPn6-TOzLoAWmgycSz1Ow,776
13
+ lesscode_database/orm/orm_typing.py,sha256=3roHzs4omS2XXcQ3yat0pb5otJZWiY52B9fsPlz9DDg,18568
14
+ lesscode_database-0.0.12.dist-info/METADATA,sha256=30YBdqfdqBxYZeavLimIzGtSLm82lqRPUeOlrQfxwsc,12213
15
+ lesscode_database-0.0.12.dist-info/WHEEL,sha256=KGYbc1zXlYddvwxnNty23BeaKzh7YuoSIvIMO4jEhvw,87
16
+ lesscode_database-0.0.12.dist-info/licenses/LICENSE,sha256=ELM9gDFm8bfsS-M5bQfUC0jn272Riqpsso986u5PdBQ,77
17
+ lesscode_database-0.0.12.dist-info/RECORD,,
@@ -1,5 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: hatchling 1.17.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
-
@@ -0,0 +1,5 @@
1
+ MIT License
2
+
3
+ Copyright (c) [year] [fullname]
4
+
5
+ Permission is hereby granted...
@@ -1 +0,0 @@
1
- __version__ = "0.0.11"
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
@@ -1,14 +0,0 @@
1
- lesscode_database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- lesscode_database/connect_pool.py,sha256=9uNqtUX_flObmhKkwoXPsN_t2Lhs-0o4CdBmmo68yeY,48144
3
- lesscode_database/connection_info.py,sha256=HMlA-hA0LE7jGUS8crZAgrBMB-o6B9mxrWYEywgqXHg,1307
4
- lesscode_database/db_options.py,sha256=Z8Iy3pqDYW5YVVfvoFSsAYecK9LfiwRasYc3fzqIBt8,1928
5
- lesscode_database/db_request.py,sha256=siZGXIdPuTlY4NwVLnU8098bVM_6jgQzSzeO4BzkDrA,4832
6
- lesscode_database/ds_helper.py,sha256=W3VrTe_l0mGX0uEbN7UI6NlQbruLpr2WXgO7AexzQ-k,4845
7
- lesscode_database/dynamic_import_package.py,sha256=J8hgGRHe6KrprOgOq-xbKHVAYHSjUBcNyTaSPvBmvIk,164
8
- lesscode_database/mongo_base_model.py,sha256=cKHNmi5GJBGRxCtqsggEcrzIZK7__Z_4cVaIHxmqZsc,6406
9
- lesscode_database/version.py,sha256=OaIl7v-6zEWEY90Jlh6yoBjO3zWX1oX7RsvqrK3o1TU,23
10
- lesscode_database-0.0.11.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
- lesscode_database-0.0.11.dist-info/METADATA,sha256=fFsDq8ciMIstY3xm8IWg88DtF4iQbpAEF3tEWiTc0aI,12066
12
- lesscode_database-0.0.11.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
13
- lesscode_database-0.0.11.dist-info/top_level.txt,sha256=h6cg13be6kkDfNaX9nWeDcfducTb5bKG5iYRO2JPmAM,18
14
- lesscode_database-0.0.11.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- lesscode_database