Návrh jazyka pro dotazování

Z FI WIKI
Přejít na: navigace, hledání

Návrh upraven 19. 5. 2005, 19:36

<?xml version="1.0" encoding="utf-8"?>
<query_specification>
	<connection>
		<( JdbcSQLConnection driver="driver" | RawDataSQLConnection | NullConnection | user_connection name="UserConnection" )>
			<!-- toto uz bude zavisle na predchozim tagu -->
			
			<!-- priklad pro JdbcSQLConnection -->
			<subprotocol>subprotocol</subprotocol>
			<subname>subname</subname>
			<user>user</user>
			<password>password</password>

			<!-- priklad pro RawDataSQLConnection -->
			<table name="name_of_the_table1">
				<definition>
					<coldef name="name1" sqltype="sqltype1" implicit="(true|false)" constraint="constraint1"/>
					<coldef name="name2" sqltype="sqltype2" implicit="(true|false)" constraint="constraint2"/>
					<coldef name="name3" sqltype="sqltype3" implicit="(true|false)" constraint="constraint3"/>
					<constraint>constraint</constraint>
				</definition>
				<row>
					<colval>value1</colval>
					<colval>value2</colval>
					<colval>value3</colval>
				</row>
				<row>
					<colval>value1</colval>
					<colval>value2</colval>
					<colval>value3</colval>
				</row>
			</table>
			<table name="name_of_the_table2">
				<definition>
					<coldef name="name1" sqltype="sqltype1" implicit="(true|false)" constraint="constraint1"/>
					<coldef name="name2" sqltype="sqltype2" implicit="(true|false)" constraint="constraint2"/>
					<coldef name="name3" sqltype="sqltype3" implicit="(true|false)" constraint="constraint3"/>
					<constraint>constraint</constraint>
				</definition>
				<row>
					<colval>value1</colval>
					<colval>value2</colval>
					<colval>value3</colval>
				</row>
				<row>
					<colval>value1</colval>
					<colval>value2</colval>
					<colval>value3</colval>
				</row>
			</table>

			<!-- priklad pro NullConnection -->
			<!-- tady - prekvapive - nebude nic -->

			<!-- priklad pro user_connection -->
			<parameter name="parameter1">value1</parameter>
			<parameter name="parameter2">value2</parameter>
			<parameter name="parameter3">value3</parameter>

		</(JdbcSQLConnection|RawDataSQLConnection|NullConnection|user_connection)>
	</connection>

	<query>
		<( SQLQuery | RawDataQuery | user_query name="UserQuery" )>
			<!-- toto uz bude zavisle na predchozim tagu -->
			
			<!-- priklad pro SQLQuery -->
			<sql_query>
				SELECT * FROM tablename WHERE colname='value';
			</sql_query>
			
			<!-- priklad pro RawDataQuery -->
			<table name="name_of_the_table1">
				<definition>
					<coldef name="name1" sqltype="sqltype1" implicit="(true|false)" constraint="constraint1"/>
					<coldef name="name2" sqltype="sqltype2" implicit="(true|false)" constraint="constraint2"/>
					<coldef name="name3" sqltype="sqltype3" implicit="(true|false)" constraint="constraint3"/>
					<constraint>constraint</constraint>
				</definition>
				<row>
					<colval>value1</colval>
					<colval>value2</colval>
					<colval>value3</colval>
				</row>
				<row>
					<colval>value1</colval>
					<colval>value2</colval>
					<colval>value3</colval>
				</row>
			</table>
			
			<!-- priklad pro user_query -->
			<parameter name="parameter1">value1</parameter>
			<parameter name="parameter2">value2</parameter>
			<parameter name="parameter3">value3</parameter>
			
		</(SQLQuery|RawDataQuery|user_query)>
	</query>
</query_specification>