1--  This file is covered by the Internet Software Consortium (ISC) License
2--  Reference: ../../License.txt
3
4with CommonText;
5with AdaBase.Interfaces.Connection;
6
7package AdaBase.Connection.Base is
8
9   package CT  renames CommonText;
10   package AIC renames AdaBase.Interfaces.Connection;
11
12   type Base_Connection is abstract new Base_Pure and
13                                        AIC.iConnection with private;
14   type Base_Connection_Access is access all Base_Connection'Class;
15
16   overriding
17   function autoCommit (conn : Base_Connection) return Boolean;
18
19   overriding
20   procedure setCaseMode (conn : out Base_Connection; mode : Case_Modes);
21
22   overriding
23   function getCaseMode (conn : Base_Connection) return Case_Modes;
24
25   overriding
26   procedure setMaxBlobSize (conn : out Base_Connection;
27                             maxsize : BLOB_Maximum);
28
29   overriding
30   function maxBlobSize (conn : Base_Connection) return BLOB_Maximum;
31
32   overriding
33   function transactionIsolation (conn : Base_Connection)
34                                  return Trax_Isolation;
35
36   overriding
37   function serverVersion (conn : Base_Connection)
38                           return String;
39
40   overriding
41   function serverInfo    (conn : Base_Connection)
42                           return String;
43
44   overriding
45   function clientVersion (conn : Base_Connection)
46                           return String;
47
48   overriding
49   function clientInfo    (conn : Base_Connection)
50                           return String;
51
52   overriding
53   function connected     (conn : Base_Connection) return Boolean;
54
55   function utf8_encoding (conn : Base_Connection) return Boolean;
56
57private
58
59   type Base_Connection is abstract new Base_Pure and AIC.iConnection with
60      record
61         prop_auto_commit    : Boolean          := False;
62         prop_active         : Boolean          := False;
63         prop_trax_isolation : Trax_Isolation   := repeatable_read;
64         prop_case_mode      : Case_Modes       := natural_case;
65         prop_max_blob       : BLOB_Maximum     := 2 ** 12;  -- 4kb
66
67         encoding_is_utf8    : Boolean := True;
68         character_set       : CT.Text := CT.SUS ("UTF8");
69         info_server         : CT.Text := CT.blank;
70         info_server_version : CT.Text := CT.blank;
71         info_client         : CT.Text := CT.blank;
72         info_client_version : CT.Text := CT.blank;
73      end record;
74
75   overriding
76   procedure finalize (conn : in out Base_Connection) is null;
77
78end AdaBase.Connection.Base;
79