basic knowledge
- 这是什么?
这是一个sql 执行中间件, 它可以从配置文件中读取,并加载配置按需生成相应的sql 并执行.
- 怎么配置
以 xmlFactory 举例.
xml 的文件格式如下
<DV>
<ID>1</ID> #dv_id
<TableName>order_head</TableName> # the table you will select from
<TopRecord>500</TopRecord> # euqal to select top
<Fields> # format will be {TrueField} as {DispField}, ${number} is a placeholder number will be replace by true table name
<Field>
<DispField>Order_date</DispField>
<TrueField>dbo.Fn_DispDateTime($0.Order_date)</TrueField>
<WhereField>$0.Order_date</WhereField>
</Field>
</Fields>
<Tables>
<Table ID="88"> # $88
<Name>V_Type</Name> # true table name
<Alias>Tp_order</Alias>
<Relation> # relations that about with this alias
$0.Order_type=$88.Type_no and $88.Type_for='Order_type' and $88.Pj_id=$0.Pj_id and $88.Status>=0
</Relation>
<JoinType>left</JoinType>
</Table>
</Tables>
</Dv>
1 how to use
engine = create_engine(self.G2CN_str)
session = sessionmaker(bind=engine)
factory = XMLFactory("D:\\chenchu\\Python\\DvManager\\test.xml")
dvm = factory.Build()
dvm.addQueryField(['Cust_no', 'Order_type_name', 'Order_date'])
# dvm.filter= DvFilter('Order_date').Equal_to('2019-10-11') #'Order_date'
dvm.filter.field_name = 'Order_date'
dvm.filter.LESS_THAN('2019-10-11')
# add field
dvm.fields['Pj_id'] = DvField(id="",disp_name='Pj_id',true_name="$0.Pj_id",where_name="$0.Pj_id")
pj_id = DvFilter('Pj_id').Equal_to('82187')
dvm.filter.AND(pj_id)
dvm.top_record = 1000
dvm.temp_tablename = "#ls"
dvm.sql_adapter = sql_server(session()) # 或许可以设为 default
print(dvm.Build())
rows = dvm.Query()
for row in rows:
print(row)
2.how to load from xml
factory = XMLFactory("./test.xml")
dvm = factory.Build()
3.how to generate a xml from a dvid
# self.AmimanagerDB == connection string
tools = dv2xml.dv2xml(self.AmimanagerDB,1)
tools.run("./test.xml")
Metadata
Release files for netsdldv 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| netsdldv-0.0.9.tar.gz | 10.0 kB | Without provenance | Details for netsdldv-0.0.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| netsdldv-0.0.9-py3-none-any.whl | Python 3 | none | any | Details for netsdldv-0.0.9-py3-none-any.whl |
Total release size: 22.3 kB
Release files / netsdldv-0.0.9.tar.gz
| Download URL | netsdldv-0.0.9.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
707cc38421197ceff506bca52ec4aec5dbd149fa4475a9e7f92570a4f0a70e8a
|
|
BLAKE2b-256 checksum How to use checksums |
5692a4c29885456ef89dba39e24c123cb3e15aca57da8cf2edce36627a40ecea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.0
|
Release files / netsdldv-0.0.9-py3-none-any.whl
| Download URL | netsdldv-0.0.9-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02be356afb79ab8fe38c2aae772218421122c4e06fff163b143adc1a4d361e10
|
|
BLAKE2b-256 checksum How to use checksums |
3d672f6b0119240296a28bf09c084e315fb4700fdd5daf60b72221efc8b0280e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.0
|
Security for netsdldv 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.