ODBC Driver for Azure Cosmos DB

Build 23.0.8839

カスタムスキーマ例

このセクションには、完全なスキーマが含まれています。info セクションではAzure Cosmos DB オブジェクトのリレーショナルビューを可能にします。詳細はカスタムスキーマ定義 を参照してください。次のテーブルではSELECT、INSERT、UPDATE、およびDELETE コマンドが以下のスキーマのGET、POST、MERGE、およびDELETE セクションとして実行されます。

スキーマにrows@next input をas-is でコピーします。 cosmosdbadoSysData のような操作は内部実装で、そのままコピーができます。

Location プロパティをスキーマファイルを格納するファイルディレクトリに設定します。

When, creating custom schemas, the attr for _rid, shown below, is required.

Also required are three properties for the _rid column definition:

  • other:dbrid is found in the _self property of an item in the collection, after "dbs/".
  • other:collrid is found in the _self property of an item in the collection, after "/colls/".
  • other:partitionpath refers to the name of the partition specified when the collection was created.

<rsb:script xmlns:rsb="http://www.rssbus.com/ns/rsbscript/2">  

  <rsb:info title="StaticRestaurants" description="Custom Schema for the restaurants data set.">  
    <!-- Column definitions -->
	<attr   name="_rid"               xs:type="string"   key="true"   other:collrid="hWdRAKRi3Pg=" other:dbrid="hWdRAA==" other:partitionpath="/name" />
    <attr   name="borough"            xs:type="string"   />
    <attr   name="cuisine"            xs:type="string"   />
    <attr   name="address.building"   xs:type="string"   />
    <attr   name="address.street"     xs:type="string"   />
    <attr   name="address.coord.0"    xs:type="double"   />
    <attr   name="address.coord.1"    xs:type="double"   />
    <input name="rows@next" desc="Internal attribute used for paging through data."  />
  </rsb:info>  

  <rsb:script method="GET">
    <rsb:call op="cosmosdbadoSysData">
      <rsb:push />
    </rsb:call>
  </rsb:script>

  <rsb:script method="POST">
    <rsb:call op="cosmosdbadoSysData">
      <rsb:push />
    </rsb:call>
  </rsb:script>

  <rsb:script method="MERGE">
    <rsb:call op="cosmosdbadoSysData">
      <rsb:push />
    </rsb:call>
  </rsb:script>

  <rsb:script method="DELETE">
    <rsb:call op="cosmosdbadoSysData">
      <rsb:push />
    </rsb:call>
  </rsb:script>

</rsb:script>

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 23.0.8839