-
Notifications
You must be signed in to change notification settings - Fork 5
/
ifx_conncache.h
84 lines (73 loc) · 1.9 KB
/
ifx_conncache.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*-------------------------------------------------------------------------
*
* ifx_conncache.c
* foreign-data wrapper for IBM INFORMIX databases
*
* Copyright (c) 2012, credativ GmbH
*
* IDENTIFICATION
* informix_fdw/ifx_conncache.h
*
*-------------------------------------------------------------------------
*/
#ifndef HAVE_IFX_CONNCACHE_H
#define HAVE_IFX_CONNCACHE_H
#include "ifx_fdw.h"
#include "nodes/pg_list.h"
#include "utils/hsearch.h"
#include "utils/dynahash.h"
/*
* Cached information for an INFORMIX
* foreign table.
*/
typedef struct IfxFTCacheItem
{
/*
* ID of the associated INFORMIX database
* connection.
*/
char ifx_connection_name[IFX_CONNAME_LEN];
Oid foreignTableOid;
/*
* XXX: Cached cost estimates for this foreign table
*/
} IfxFTCacheItem;
/*
* Cached informix database connection.
* Derived from IfxPGCachedConnection.
*/
typedef struct IfxCachedConnection
{
IfxPGCachedConnection con;
Oid establishedByOid;
} IfxCachedConnection;
/*
* Caches INFORMIX database connections and foreign
* table informations.
*/
typedef struct InformixCache
{
HTAB *connections;
HTAB *tables;
} InformixCache;
/*
* Global module options
*
* IfxCacheIsInitialized: indicates wether the cache structure
* was already initialized.
* ifxCache: INFORMIX connection and foreign table properties cache
*/
extern bool IfxCacheIsInitialized;
extern InformixCache ifxCache;
void InformixCacheInit(void);
/*
* Register a new INFORMIX foreign table to the cache.
*/
IfxFTCacheItem *ifxFTCache_add(Oid foreignTableOid, char *conname);
IfxCachedConnection *ifxConnCache_add(Oid foreignTableOid,
IfxConnectionInfo *coninfo,
bool *found);
IfxCachedConnection *ifxConnCache_rm(char *conname,
bool *found);
IfxCachedConnection *ifxConnCache_exists(char *conname, bool *found);
#endif