--- /dev/null
+/* RCS $Id: CosQueryCollection.idl,v 1.1 1998/11/16 18:03:34 scrappy Exp $\r
+ *\r
+ * ----------------------------------------------------------------------------\r
+ * This is unmarked software provided by the Object Management Group,Inc. (OMG)\r
+ * ----------------------------------------------------------------------------\r
+ */\r
+\r
+\r
+/**\r
+ * CosQueryCollection is the Common Object Services Specification query \r
+ * query colleciton module as it it appears in COSS1, v1.0.\r
+ */\r
+\r
+\r
+#ifndef CosQueryCollection_idl\r
+#define CosQueryCollection_idl\r
+\r
+module CosQueryCollection {\r
+\r
+ exception ElementInvalid {}; \r
+ exception IteratorInvalid {}; \r
+ exception PositionInvalid {};\r
+\r
+ typedef string Istring; \r
+ struct NVPair {\r
+ Istring name; \r
+ any value;\r
+ }; \r
+\r
+ typedef sequence<NVPair> ParameterList;\r
+\r
+ interface Collection; \r
+ interface Iterator;\r
+\r
+ interface CollectionFactory { \r
+ Collection create (in ParameterList params); \r
+ };\r
+\r
+ interface Collection { \r
+\r
+ readonly attribute long cardinality;\r
+\r
+ void add_element (in any element) \r
+ raises(ElementInvalid); \r
+\r
+ void add_all_elements (in Collection elements) \r
+ raises(ElementInvalid);\r
+\r
+ void insert_element_at (in any element, in Iterator where) \r
+ raises(IteratorInvalid,\r
+ ElementInvalid);\r
+\r
+ void replace_element_at (in any element, in Iterator where) \r
+ raises(IteratorInvalid,\r
+ PositionInvalid,\r
+ ElementInvalid);\r
+\r
+ void remove_element_at (in Iterator where) \r
+ raises(IteratorInvalid,\r
+ PositionInvalid); \r
+\r
+ void remove_all_elements ();\r
+\r
+ any retrieve_element_at (in Iterator where) \r
+ raises(IteratorInvalid,\r
+ PositionInvalid);\r
+\r
+ Iterator create_iterator ();\r
+\r
+ };\r
+\r
+ interface Iterator { \r
+ any next ()\r
+ raises(IteratorInvalid,\r
+ PositionInvalid);\r
+ void reset ();\r
+ boolean more (); \r
+ }; \r
+\r
+};\r
+\r
+#endif // CosQueryCollection_idl\r
+\r
--- /dev/null
+#include "CosQueryCollection.idl"\r
+\r
+#ifndef pgsql_idl\r
+#define pgsql_idl\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<Value> Row;\r
+ \r
+ // <info>\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
+ // </info>\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
+\r
+#endif // pgsql_idl\r