Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit91a6248

Browse files
committed
From: Taral <taral@cyberjunkie.com>More COS Query Service support.
1 parent935a2e6 commit91a6248

File tree

2 files changed

+161
-71
lines changed

2 files changed

+161
-71
lines changed

‎src/corba/CosQuery.idl

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/* RCS $Id: CosQuery.idl,v 1.1 1998/11/17 03:10:35 scrappy Exp $
2+
*
3+
* ----------------------------------------------------------------------------
4+
* This is unmarked software provided by the Object Management Group,Inc. (OMG)
5+
* ----------------------------------------------------------------------------
6+
*/
7+
8+
9+
/**
10+
* CosQuery is the Common Object Services Specification query module
11+
* as it it appears in COSS1, v1.0.
12+
*/
13+
14+
15+
#ifndef CosQuery_idl
16+
#define CosQuery_idl
17+
18+
#ifndef CosQueryCollection_idl
19+
#include "CosQueryCollection.idl"
20+
#endif
21+
22+
module CosQuery {
23+
24+
exception QueryInvalid {string why;};
25+
exception QueryProcessingError {string why;};
26+
exception QueryTypeInvalid {};
27+
28+
enum QueryStatus {complete, incomplete};
29+
30+
typedef CosQueryCollection::ParameterList ParameterList;
31+
32+
typedef CORBA::InterfaceDef QLType;
33+
typedef sequence<QLType> QLTypeSeq;
34+
35+
interface Query;
36+
interface QueryLanguageType {};
37+
interface SQLQuery : QueryLanguageType {};
38+
interface SQL_92Query : SQLQuery {};
39+
interface OQL : QueryLanguageType {};
40+
interface OQLBasic : OQL {};
41+
interface OQL_93 : OQL {};
42+
interface OQL_93Basic : OQL_93, OQLBasic {};
43+
44+
interface QueryEvaluator {
45+
46+
readonly attribute QLTypeSeq ql_types;
47+
readonly attribute QLType default_ql_type;
48+
49+
any evaluate (in string query,
50+
in QLType ql_type,
51+
in ParameterList params)
52+
raises(QueryTypeInvalid,
53+
QueryInvalid,
54+
QueryProcessingError);
55+
};
56+
57+
interface QueryableCollection : QueryEvaluator,
58+
CosQueryCollection::Collection {
59+
60+
};
61+
62+
interface QueryManager : QueryEvaluator {
63+
64+
Query create (in string query,
65+
in QLType ql_type,
66+
in ParameterList params)
67+
raises(QueryTypeInvalid,
68+
QueryInvalid);
69+
70+
};
71+
72+
interface Query {
73+
74+
readonly attribute QueryManager query_mgr;
75+
76+
void prepare (in ParameterList params)
77+
raises(QueryProcessingError);
78+
79+
void execute (in ParameterList params)
80+
raises(QueryProcessingError);
81+
82+
QueryStatus get_status ();
83+
84+
any get_result ();
85+
};
86+
87+
};
88+
89+
#endif // CosQuery_idl

‎src/corba/pgsql.idl

Lines changed: 72 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,79 @@
1-
#include "CosQueryCollection.idl"
2-
31
#ifndef pgsql_idl
42
#define pgsql_idl
53

4+
#ifndef CosQuery_idl
5+
#include "CosQuery.idl"
6+
#endif
7+
8+
#ifndef CosQueryCollection_idl
9+
#include "CosQueryCollection.idl"
10+
#endif
11+
612
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+
};
7677
};
7778

7879
#endif // pgsql_idl

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp