Skip to main content

a tools for ami

Project description

basic knowledge

  • 这是什么?
这是一个sql 执行中间件, 它可以从配置文件中读取,并加载配置按需生成相应的sql 并执行.
  • 怎么配置
以 xmlFactory 举例.
xml 的文件格式如下
		<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
			<Table ID="88"> # $88
				<Name>V_Type</Name> # true table name
				<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&gt;=0


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'

        # 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.top_record = 1000
        dvm.temp_tablename = "#ls"

        dvm.sql_adapter = sql_server(session()) # 或许可以设为 default
        rows = dvm.Query()
        for row in rows:
            print(row) to load from xml

        factory = XMLFactory("./test.xml")
        dvm = factory.Build() to generate a xml from a dvid

        # self.AmimanagerDB == connection string
        tools = dv2xml.dv2xml(self.AmimanagerDB,1)"./test.xml")

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netsdldv-0.0.9.tar.gz (10.0 kB view hashes)

Uploaded source

Built Distribution

netsdldv-0.0.9-py3-none-any.whl (12.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page