--- /dev/null
+/* RCS $Id: CosQuery.idl,v 1.1 1998/11/17 03:10:35 scrappy Exp $\r
+ *\r
+ * ----------------------------------------------------------------------------\r
+ * This is unmarked software provided by the Object Management Group,Inc. (OMG)\r
+ * ----------------------------------------------------------------------------\r
+ */\r
+\r
+\r
+/**\r
+ * CosQuery is the Common Object Services Specification query module\r
+ * as it it appears in COSS1, v1.0.\r
+ */\r
+\r
+\r
+#ifndef CosQuery_idl\r
+#define CosQuery_idl\r
+\r
+#ifndef CosQueryCollection_idl\r
+#include "CosQueryCollection.idl"\r
+#endif\r
+\r
+module CosQuery {\r
+\r
+ exception QueryInvalid {string why;}; \r
+ exception QueryProcessingError {string why;}; \r
+ exception QueryTypeInvalid {};\r
+\r
+ enum QueryStatus {complete, incomplete};\r
+\r
+ typedef CosQueryCollection::ParameterList ParameterList;\r
+\r
+ typedef CORBA::InterfaceDef QLType;\r
+ typedef sequence QLTypeSeq;\r
+\r
+ interface Query;\r
+ interface QueryLanguageType {}; \r
+ interface SQLQuery : QueryLanguageType {}; \r
+ interface SQL_92Query : SQLQuery {}; \r
+ interface OQL : QueryLanguageType {}; \r
+ interface OQLBasic : OQL {}; \r
+ interface OQL_93 : OQL {}; \r
+ interface OQL_93Basic : OQL_93, OQLBasic {};\r
+\r
+ interface QueryEvaluator { \r
+\r
+ readonly attribute QLTypeSeq ql_types; \r
+ readonly attribute QLType default_ql_type;\r
+\r
+ any evaluate (in string query,\r
+ in QLType ql_type, \r
+ in ParameterList params) \r
+ raises(QueryTypeInvalid,\r
+ QueryInvalid,\r
+ QueryProcessingError); \r
+ };\r
+\r
+ interface QueryableCollection : QueryEvaluator, \r
+ CosQueryCollection::Collection {\r
+\r
+ };\r
+\r
+ interface QueryManager : QueryEvaluator { \r
+\r
+ Query create (in string query,\r
+ in QLType ql_type, \r
+ in ParameterList params) \r
+ raises(QueryTypeInvalid,\r
+ QueryInvalid);\r
+\r
+ };\r
+\r
+ interface Query { \r
+\r
+ readonly attribute QueryManager query_mgr;\r
+\r
+ void prepare (in ParameterList params) \r
+ raises(QueryProcessingError); \r
+\r
+ void execute (in ParameterList params) \r
+ raises(QueryProcessingError);\r
+\r
+ QueryStatus get_status (); \r
+\r
+ any get_result (); \r
+ };\r
+\r
+};\r
+\r
+#endif // CosQuery_idl\r
-#include "CosQueryCollection.idl"\r
-\r
#ifndef pgsql_idl\r
#define pgsql_idl\r
\r
+#ifndef CosQuery_idl\r
+#include "CosQuery.idl"\r
+#endif\r
+\r
+#ifndef CosQueryCollection_idl\r
+#include "CosQueryCollection.idl"\r
+#endif\r
+\r
module PostgreSQL {\r
- \r
- // Built-in types\r
- \r
- module Types {\r
- // Arrays in network order\r
- typedef short int2;\r
- typedef long int4;\r
- typedef long int8[2];\r
- };\r
- \r
- \r
- // NULL support\r
- \r
- typedef boolean Null;\r
- \r
- union Value switch (Null) {\r
- case false: any value;\r
- };\r
- \r
- typedef sequence Row;\r
- \r
- // \r
- // More about the application of COSS:\r
- // \r
- // A Table will be a QueryableCollection of Rows\r
- // A Database will be a QueryableCollection of Tables\r
- // Both will be queryable via the Query Service\r
- // \r
- // Other relations will be representable using the Relationship Service\r
- // This includes primary/foreign keys and anything else :)\r
- // \r
- // GRANT/REVOKE can be supplied via the Security Service\r
- // \r
- // See a pattern here? The whole of SQL can be implemented by these services!\r
- // The statements go through a parser. Queries and subqueries are passed to the\r
- // database for processing. Returned items are handled appropriately:\r
- // \r
- // SELECT: return the items to the caller\r
- // UPDATE: modify the items (direct)\r
- // DELETE: call delete() on each Row (direct)\r
- // GRANT/REVOKE: modify ACLs (via Security Service)\r
- // ALTER: modify the items (direct) and/or the relations (via Relationship Service)\r
- // etc.\r
- // \r
- // I'm not sure yet about LOCK and UNLOCK.\r
- // \r
- \r
- \r
- // Query result interface\r
- // \r
- // Should the iterator support a 'boolean skip(in long n)' extension?\r
- \r
- interface QueryResult : CosQueryCollection::Collection {};\r
- interface QueryResultIterator : CosQueryCollection::Iterator {};\r
- \r
- \r
- // Connected database object\r
- \r
- interface Database {\r
- QueryResult exec(in string query);\r
- void disconnect();\r
- };\r
- \r
- \r
- // Server object (stateless)\r
- \r
- interface Server {\r
- Database connect(in string db, in string user, in string password);\r
- };\r
+ \r
+ // Built-in types\r
+ \r
+ module Types {\r
+ // Arrays in network order\r
+ typedef short int2;\r
+ typedef long int4;\r
+ typedef long int8[2];\r
+ };\r
+ \r
+ \r
+ // NULL support\r
+ \r
+ typedef boolean Null;\r
+ \r
+ union Value switch (Null) {\r
+ case false: any value;\r
+ };\r
+ \r
+ \r
+ // Row definition\r
+ \r
+ typedef sequence Row;\r
+ \r
+ // \r
+ // More about the application of COSS:\r
+ // \r
+ // A Table will be a QueryableCollection of Rows\r
+ // A Database will be a QueryableCollection of Tables\r
+ // (Currently Tables are not exported... maybe later.)\r
+ // Both will be queryable via the Query Service\r
+ // \r
+ // Other relations will be representable using the Relationship Service\r
+ // This includes primary/foreign keys and anything else :)\r
+ // \r
+ // GRANT/REVOKE can be supplied via the Security Service\r
+ // \r
+ // See a pattern here? The whole of SQL can be implemented by these services!\r
+ // The statements go through a parser. Queries and subqueries are passed to the\r
+ // database for processing. Returned items are handled appropriately:\r
+ // \r
+ // SELECT: return the items to the caller\r
+ // UPDATE: modify the items (direct)\r
+ // DELETE: call delete() on each Row (direct)\r
+ // GRANT/REVOKE: modify ACLs (via Security Service)\r
+ // ALTER: modify the items (direct) and/or the relations (via Relationship Service)\r
+ // etc.\r
+ // \r
+ // I'm not sure yet about LOCK and UNLOCK.\r
+ // \r
+ \r
+ \r
+ // Connected database object\r
+ \r
+ interface Database : CosQuery::QueryableCollection {\r
+ void disconnect();\r
+ };\r
+ \r
+ \r
+ // Server object (stateless)\r
+ \r
+ interface Server {\r
+ Database connect(in string db, in string user, in string password);\r
+ };\r
};\r
\r
#endif // pgsql_idl\r