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