liquisource 0.0.1__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.
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.1
2
+ Name: liquisource
3
+ Version: 0.0.1
4
+ Summary: A package for liquibase monogo or clickhosue client.
5
+ Home-page: http://github.com/jiyis/liquisource
6
+ Author: garypdong
7
+ Author-email: garypdong@tencent.com
8
+ Keywords: liquisource
@@ -0,0 +1,48 @@
1
+ # liquibase数据源驱动
2
+ > liquibase引入python3脚本,统一管理管理mongo、clickhouse的库表结构。changelog记录还是选在记录到mysql中,这样业务上会更加灵活
3
+ ```xml
4
+ <changeSet id="xxxxx" author="xxxxxx" labels="mongo">
5
+ <comment>xxxxx</comment>
6
+ <executeCommand executable="python3">
7
+ <arg value="script/db_tag/creat_collection.py"/>
8
+ </executeCommand>
9
+ </changeSet>
10
+ ```
11
+ ```python
12
+ #!/usr/bin/env python3
13
+ # -*- coding: utf-8 -*-
14
+
15
+ from liquibase_datasource import *
16
+
17
+
18
+ def create_tag_database():
19
+ # 获取mongo链接实例
20
+ client = get_client(filepath)
21
+
22
+
23
+ return client[db]
24
+
25
+
26
+ def create_tag_collection():
27
+ # 获取mongo链接实例
28
+ db_name = get_tenant_shard(tag_database)
29
+ client = get_client()
30
+ db = client[db_name]
31
+
32
+ # db开启分片
33
+ client.admin.command("enableSharding", db_name)
34
+
35
+ db.create_collection(tag_collection)
36
+
37
+ # 创建索引
38
+ coll = db[tag_collection]
39
+ coll.create_index(
40
+ [("id", 1), ("name", 1)])
41
+
42
+
43
+ if __name__ == "__main__":
44
+ # 创建标签集合
45
+ create_tag_database()
46
+ create_tag_collection()
47
+
48
+ ```
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.1
2
+ Name: liquisource
3
+ Version: 0.0.1
4
+ Summary: A package for liquibase monogo or clickhosue client.
5
+ Home-page: http://github.com/jiyis/liquisource
6
+ Author: garypdong
7
+ Author-email: garypdong@tencent.com
8
+ Keywords: liquisource
@@ -0,0 +1,7 @@
1
+ README.md
2
+ setup.py
3
+ liquisource.egg-info/PKG-INFO
4
+ liquisource.egg-info/SOURCES.txt
5
+ liquisource.egg-info/dependency_links.txt
6
+ liquisource.egg-info/requires.txt
7
+ liquisource.egg-info/top_level.txt
@@ -0,0 +1,4 @@
1
+ setuptools
2
+ jproperties
3
+ clickhouse_connect
4
+ pymongo
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,18 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="liquisource",
5
+ version="0.0.1",
6
+ packages=find_packages(),
7
+ install_requires=[
8
+ "setuptools",
9
+ "jproperties",
10
+ "clickhouse_connect",
11
+ "pymongo"
12
+ ],
13
+ author="garypdong",
14
+ author_email="garypdong@tencent.com",
15
+ description="A package for liquibase monogo or clickhosue client.",
16
+ keywords="liquisource",
17
+ url="http://github.com/jiyis/liquisource"
18
+ )