]> granicus.if.org Git - postgresql/commitdiff
Start defining the Corba work...
authorMarc G. Fournier <scrappy@hub.org>
Mon, 16 Nov 1998 18:03:34 +0000 (18:03 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Mon, 16 Nov 1998 18:03:34 +0000 (18:03 +0000)
From: Taral <taral@cyberjunkie.com>

src/corba/CosQueryCollection.idl [new file with mode: 0644]
src/corba/pgsql.idl [new file with mode: 0644]

diff --git a/src/corba/CosQueryCollection.idl b/src/corba/CosQueryCollection.idl
new file mode 100644 (file)
index 0000000..f6473d4
--- /dev/null
@@ -0,0 +1,83 @@
+/* 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
diff --git a/src/corba/pgsql.idl b/src/corba/pgsql.idl
new file mode 100644 (file)
index 0000000..33c5484
--- /dev/null
@@ -0,0 +1,78 @@
+#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