syncmodels 0.1.325__py2.py3-none-any.whl → 0.1.327__py2.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.
- syncmodels/__init__.py +1 -1
- syncmodels/storage.py +31 -19
- {syncmodels-0.1.325.dist-info → syncmodels-0.1.327.dist-info}/METADATA +2 -2
- {syncmodels-0.1.325.dist-info → syncmodels-0.1.327.dist-info}/RECORD +9 -9
- {syncmodels-0.1.325.dist-info → syncmodels-0.1.327.dist-info}/AUTHORS.rst +0 -0
- {syncmodels-0.1.325.dist-info → syncmodels-0.1.327.dist-info}/LICENSE +0 -0
- {syncmodels-0.1.325.dist-info → syncmodels-0.1.327.dist-info}/WHEEL +0 -0
- {syncmodels-0.1.325.dist-info → syncmodels-0.1.327.dist-info}/entry_points.txt +0 -0
- {syncmodels-0.1.325.dist-info → syncmodels-0.1.327.dist-info}/top_level.txt +0 -0
syncmodels/__init__.py
CHANGED
syncmodels/storage.py
CHANGED
@@ -981,7 +981,7 @@ class WaveStorage(iWaves, iStorage):
|
|
981
981
|
**data_sort_blueprint, # implies sv = True
|
982
982
|
}
|
983
983
|
# requests index creation
|
984
|
-
self.register_index(uid, [ORG_KEY])
|
984
|
+
self.register_index(uid, [ORG_KEY, MONOTONIC_KEY])
|
985
985
|
|
986
986
|
identical = await self.storage.query(
|
987
987
|
query,
|
@@ -993,8 +993,10 @@ class WaveStorage(iWaves, iStorage):
|
|
993
993
|
# TODO: review different structures case
|
994
994
|
similar_bp = {
|
995
995
|
LIMIT_KEY: kw.get(
|
996
|
-
LIMIT_KEY,
|
996
|
+
LIMIT_KEY, 25 # TODO: agp: set in definition?
|
997
997
|
), # TODO: this is temporal, ideally None
|
998
|
+
# ORDER_KEY: MONOTONIC_KEY,
|
999
|
+
# DIRECTION_KEY: DIRECTION_DESC,
|
998
1000
|
ORG_KEY: uid,
|
999
1001
|
**data_sort_blueprint, # implies sv = True
|
1000
1002
|
}
|
@@ -1177,7 +1179,7 @@ class WaveStorage(iWaves, iStorage):
|
|
1177
1179
|
|
1178
1180
|
# TODO: hack to speed up the process for some data
|
1179
1181
|
# TODO: remove when not needed
|
1180
|
-
must_check =
|
1182
|
+
must_check = False or kw.get(KIND_KEY) not in ("raw_energy",)
|
1181
1183
|
if must_check:
|
1182
1184
|
t0 = time.time()
|
1183
1185
|
await prevously_inserted()
|
@@ -1185,7 +1187,7 @@ class WaveStorage(iWaves, iStorage):
|
|
1185
1187
|
log.info("[%s] prevously_inserted took: %s secs", uid, elapsed)
|
1186
1188
|
else:
|
1187
1189
|
# hack for not altering the data
|
1188
|
-
push = False
|
1190
|
+
# push = False
|
1189
1191
|
pass
|
1190
1192
|
|
1191
1193
|
# check if ORG_KEY could be formated wrong
|
@@ -1650,21 +1652,31 @@ class SurrealistStorage(Storage):
|
|
1650
1652
|
connection = pool.connections.get(key) or await pool._connect(*key)
|
1651
1653
|
assert connection, "surreal connection has failed"
|
1652
1654
|
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1655
|
+
result = []
|
1656
|
+
for col in columns:
|
1657
|
+
name = f"idx_{table}_{col}"
|
1658
|
+
sql = f"DEFINE INDEX IF NOT EXISTS {name} ON TABLE {table} COLUMNS {col}"
|
1659
|
+
log.info("creating index: [%s] on [%s]", name, col)
|
1660
|
+
res = connection.query(sql)
|
1661
|
+
result.append(res.result)
|
1662
|
+
|
1663
|
+
# all together
|
1664
|
+
# sufix = "_".join(columns)
|
1665
|
+
# keynames = ", ".join(columns)
|
1666
|
+
# # TODO: agp: comment these lines next week :)
|
1667
|
+
# # name = f"index_{table}_{sufix}"
|
1668
|
+
# # sql = f"REMOVE INDEX IF EXISTS {name} ON TABLE {table}"
|
1669
|
+
# # log.info("deleting index: [%s] on [%s]", name, keynames)
|
1670
|
+
# # res = connection.query(sql)
|
1671
|
+
# # log.info("result: [%s]", res)
|
1672
|
+
#
|
1673
|
+
# name = f"idx_{table}_{sufix}"
|
1674
|
+
# sql = f"DEFINE INDEX IF NOT EXISTS {name} ON TABLE {table} COLUMNS {keynames}"
|
1675
|
+
# log.info("creating index: [%s] on [%s]", name, keynames)
|
1676
|
+
# res = connection.query(sql)
|
1677
|
+
# result.append(res.result)
|
1678
|
+
|
1679
|
+
return all(result)
|
1668
1680
|
|
1669
1681
|
async def start(self):
|
1670
1682
|
"any action related to start storage operations"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: syncmodels
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.327
|
4
4
|
Summary: Synchronizable Models
|
5
5
|
Home-page: https://github.com/asterio.gonzalez/syncmodels
|
6
6
|
Author: Asterio Gonzalez
|
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
18
18
|
Requires-Python: >=3.6
|
19
19
|
License-File: LICENSE
|
20
20
|
License-File: AUTHORS.rst
|
21
|
-
Requires-Dist: agptools>=0.1.
|
21
|
+
Requires-Dist: agptools>=0.1.327
|
22
22
|
Requires-Dist: aiocache
|
23
23
|
Requires-Dist: aiohttp
|
24
24
|
Requires-Dist: Click
|
@@ -1,4 +1,4 @@
|
|
1
|
-
syncmodels/__init__.py,sha256=
|
1
|
+
syncmodels/__init__.py,sha256=2FqJaCalg0XIWw7bbMhpW7dkTF3bH4dMG09Sn5xtZ_M,142
|
2
2
|
syncmodels/context.py,sha256=k1Gs_ip9BfyRFpyRnzqYvRDKo0sYBqJsh6z9sWln9oE,451
|
3
3
|
syncmodels/crawler.py,sha256=_pgelyrIKuVl8vdINJ6NSh5qkSnZf4rAACph4SZ_2H4,95281
|
4
4
|
syncmodels/crud.py,sha256=oZIcwEKR2i-lesEF_059Y4yThohd9m7gs6R6xYgLH-I,15351
|
@@ -11,7 +11,7 @@ syncmodels/registry.py,sha256=YaQtgbSwa0je1MpCcVHALI3_b85vrddyOlhsnrUcKZs,8224
|
|
11
11
|
syncmodels/requests.py,sha256=wWoC5hPDm1iBM_zrlyKRauzhXgdKR3pT5RqyC-5UZhQ,538
|
12
12
|
syncmodels/runner.py,sha256=IHDKuQ3yJ1DN9wktMiIrerPepYX61tc3AzbFfuUqEFw,5454
|
13
13
|
syncmodels/schema.py,sha256=uinUt8Asq_x7xa6MKWVXNyoWO6gKocjGPppjimaXzEU,2492
|
14
|
-
syncmodels/storage.py,sha256=
|
14
|
+
syncmodels/storage.py,sha256=KD5r1C9W444Ok4iBRJN3suFxHgm9W0th6sts0hC2gc0,74546
|
15
15
|
syncmodels/syncmodels.py,sha256=jcUxVbv1hrx5hI81VCO1onIM6WyORTqJVPwIqlPocOc,10596
|
16
16
|
syncmodels/timequeue.py,sha256=YRd3ULRaIhoszaBsYhfr0epMqAbL6-NwVEtScjUYttM,595
|
17
17
|
syncmodels/wave.py,sha256=Gra22BLiA9z2nF-6diXpjAc4GZv9nebmyvHxdAfXec4,7764
|
@@ -302,10 +302,10 @@ syncmodels/session/postgresql.py,sha256=ZMIu1Rv93pKfvFlovFBmWArzlrT2xaQWNYGZT_LW
|
|
302
302
|
syncmodels/session/sql.py,sha256=7FbiKpnalFWkG9AEMDPloJ_IByyViwOR4EZRi1f7ulw,6570
|
303
303
|
syncmodels/session/sqlite.py,sha256=nCDjopLiBpX1F10qkKoARM7JrVdIpJ1WdGOduFVxaiA,2080
|
304
304
|
syncmodels/source/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
305
|
-
syncmodels-0.1.
|
306
|
-
syncmodels-0.1.
|
307
|
-
syncmodels-0.1.
|
308
|
-
syncmodels-0.1.
|
309
|
-
syncmodels-0.1.
|
310
|
-
syncmodels-0.1.
|
311
|
-
syncmodels-0.1.
|
305
|
+
syncmodels-0.1.327.dist-info/AUTHORS.rst,sha256=3ZPoqg8Aav8DSYKd0fwcwn4_5HwSiMLart0E5Un00-U,168
|
306
|
+
syncmodels-0.1.327.dist-info/LICENSE,sha256=uzMOYtIiUsnsD0xHJR7aJWJ4v_bvan0kTnvufy5eNoA,1075
|
307
|
+
syncmodels-0.1.327.dist-info/METADATA,sha256=4dT_UYOSiJ28CdEIMgqyJskttKjyDYhtl2de7cdgvLY,2700
|
308
|
+
syncmodels-0.1.327.dist-info/WHEEL,sha256=SrDKpSbFN1G94qcmBqS9nyHcDMp9cUS9OC06hC0G3G0,109
|
309
|
+
syncmodels-0.1.327.dist-info/entry_points.txt,sha256=dMnigjZsHMxTwXiiZyBZdBbMYE0-hY3L5cG15EcDAzw,51
|
310
|
+
syncmodels-0.1.327.dist-info/top_level.txt,sha256=2DfQ9NuAhKMjY3BvQGVBA7GfqTm7EoHNbaehSUiqiHQ,11
|
311
|
+
syncmodels-0.1.327.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|