|
1 |
| -#include "CosQueryCollection.idl" |
2 |
| - |
3 | 1 | #ifndef pgsql_idl
|
4 | 2 | #define pgsql_idl
|
5 | 3 |
|
| 4 | +#ifndef CosQuery_idl |
| 5 | +#include "CosQuery.idl" |
| 6 | +#endif |
| 7 | + |
| 8 | +#ifndef CosQueryCollection_idl |
| 9 | +#include "CosQueryCollection.idl" |
| 10 | +#endif |
| 11 | + |
6 | 12 | module PostgreSQL {
|
7 |
| - |
8 |
| - // Built-in types |
9 |
| - |
10 |
| - module Types { |
11 |
| - // Arrays in network order |
12 |
| - typedef short int2; |
13 |
| - typedef long int4; |
14 |
| - typedef long int8[2]; |
15 |
| - }; |
16 |
| - |
17 |
| - |
18 |
| - // NULL support |
19 |
| - |
20 |
| - typedef boolean Null; |
21 |
| - |
22 |
| - union Value switch (Null) { |
23 |
| - case false: any value; |
24 |
| - }; |
25 |
| - |
26 |
| - typedef sequence<Value> Row; |
27 |
| - |
28 |
| - // <info> |
29 |
| - // More about the application of COSS: |
30 |
| - // |
31 |
| - // A Table will be a QueryableCollection of Rows |
32 |
| - // A Database will be a QueryableCollection of Tables |
33 |
| - // Both will be queryable via the Query Service |
34 |
| - // |
35 |
| - // Other relations will be representable using the Relationship Service |
36 |
| - // This includes primary/foreign keys and anything else :) |
37 |
| - // |
38 |
| - // GRANT/REVOKE can be supplied via the Security Service |
39 |
| - // |
40 |
| - // See a pattern here? The whole of SQL can be implemented by these services! |
41 |
| - // The statements go through a parser. Queries and subqueries are passed to the |
42 |
| - // database for processing. Returned items are handled appropriately: |
43 |
| - // |
44 |
| - // SELECT: return the items to the caller |
45 |
| - // UPDATE: modify the items (direct) |
46 |
| - // DELETE: call delete() on each Row (direct) |
47 |
| - // GRANT/REVOKE: modify ACLs (via Security Service) |
48 |
| - // ALTER: modify the items (direct) and/or the relations (via Relationship Service) |
49 |
| - // etc. |
50 |
| - // |
51 |
| - // I'm not sure yet about LOCK and UNLOCK. |
52 |
| - // </info> |
53 |
| - |
54 |
| - |
55 |
| - // Query result interface |
56 |
| - // |
57 |
| - // Should the iterator support a 'boolean skip(in long n)' extension? |
58 |
| - |
59 |
| - interface QueryResult : CosQueryCollection::Collection {}; |
60 |
| - interface QueryResultIterator : CosQueryCollection::Iterator {}; |
61 |
| - |
62 |
| - |
63 |
| - // Connected database object |
64 |
| - |
65 |
| - interface Database { |
66 |
| - QueryResult exec(in string query); |
67 |
| - void disconnect(); |
68 |
| - }; |
69 |
| - |
70 |
| - |
71 |
| - // Server object (stateless) |
72 |
| - |
73 |
| - interface Server { |
74 |
| - Database connect(in string db, in string user, in string password); |
75 |
| - }; |
| 13 | + |
| 14 | + // Built-in types |
| 15 | + |
| 16 | + module Types { |
| 17 | + // Arrays in network order |
| 18 | + typedef short int2; |
| 19 | + typedef long int4; |
| 20 | + typedef long int8[2]; |
| 21 | + }; |
| 22 | + |
| 23 | + |
| 24 | + // NULL support |
| 25 | + |
| 26 | + typedef boolean Null; |
| 27 | + |
| 28 | + union Value switch (Null) { |
| 29 | + case false: any value; |
| 30 | + }; |
| 31 | + |
| 32 | + |
| 33 | + // Row definition |
| 34 | + |
| 35 | + typedef sequence<Value> Row; |
| 36 | + |
| 37 | + // <info> |
| 38 | + // More about the application of COSS: |
| 39 | + // |
| 40 | + // A Table will be a QueryableCollection of Rows |
| 41 | + // A Database will be a QueryableCollection of Tables |
| 42 | + // (Currently Tables are not exported... maybe later.) |
| 43 | + // Both will be queryable via the Query Service |
| 44 | + // |
| 45 | + // Other relations will be representable using the Relationship Service |
| 46 | + // This includes primary/foreign keys and anything else :) |
| 47 | + // |
| 48 | + // GRANT/REVOKE can be supplied via the Security Service |
| 49 | + // |
| 50 | + // See a pattern here? The whole of SQL can be implemented by these services! |
| 51 | + // The statements go through a parser. Queries and subqueries are passed to the |
| 52 | + // database for processing. Returned items are handled appropriately: |
| 53 | + // |
| 54 | + // SELECT: return the items to the caller |
| 55 | + // UPDATE: modify the items (direct) |
| 56 | + // DELETE: call delete() on each Row (direct) |
| 57 | + // GRANT/REVOKE: modify ACLs (via Security Service) |
| 58 | + // ALTER: modify the items (direct) and/or the relations (via Relationship Service) |
| 59 | + // etc. |
| 60 | + // |
| 61 | + // I'm not sure yet about LOCK and UNLOCK. |
| 62 | + // </info> |
| 63 | + |
| 64 | + |
| 65 | + // Connected database object |
| 66 | + |
| 67 | + interface Database : CosQuery::QueryableCollection { |
| 68 | + void disconnect(); |
| 69 | + }; |
| 70 | + |
| 71 | + |
| 72 | + // Server object (stateless) |
| 73 | + |
| 74 | + interface Server { |
| 75 | + Database connect(in string db, in string user, in string password); |
| 76 | + }; |
76 | 77 | };
|
77 | 78 |
|
78 | 79 | #endif // pgsql_idl
|
0 commit comments