-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsynchdb--1.0.sql
58 lines (41 loc) · 2.18 KB
/
synchdb--1.0.sql
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
--complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION synchdb" to load this file. \quit
CREATE OR REPLACE FUNCTION synchdb_start_engine_bgw(text) RETURNS int
AS '$libdir/synchdb', 'synchdb_start_engine_bgw'
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION synchdb_start_engine_bgw(text, text) RETURNS int
AS '$libdir/synchdb', 'synchdb_start_engine_bgw_snapshot_mode'
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION synchdb_stop_engine_bgw(text) RETURNS int
AS '$libdir/synchdb'
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION synchdb_get_state() RETURNS SETOF record
AS '$libdir/synchdb'
LANGUAGE C IMMUTABLE STRICT;
CREATE VIEW synchdb_state_view AS SELECT * FROM synchdb_get_state() AS (name text, connector_type text, pid int, stage text, state text, err text, last_dbz_offset text);
CREATE OR REPLACE FUNCTION synchdb_pause_engine(text) RETURNS int
AS '$libdir/synchdb'
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION synchdb_resume_engine(text) RETURNS int
AS '$libdir/synchdb'
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION synchdb_set_offset(text, text) RETURNS int
AS '$libdir/synchdb'
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION synchdb_add_conninfo(text, text, int, text, text, text, text, text, text, text) RETURNS int
AS '$libdir/synchdb'
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION synchdb_restart_connector(text, text) RETURNS int
AS '$libdir/synchdb'
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION synchdb_log_jvm_meminfo(text) RETURNS int
AS '$libdir/synchdb'
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION synchdb_get_stats() RETURNS SETOF record
AS '$libdir/synchdb'
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION synchdb_reset_stats(text) RETURNS int
AS '$libdir/synchdb'
LANGUAGE C IMMUTABLE STRICT;
CREATE VIEW synchdb_stats_view AS SELECT * FROM synchdb_get_stats() AS (name text, ddls bigint, dmls bigint, reads bigint, creates bigint, updates bigint, deletes bigint, bad_events bigint, total_events bigint, batches_done bigint, avg_batch_size bigint);
CREATE TABLE IF NOT EXISTS synchdb_conninfo(name TEXT PRIMARY KEY, isactive BOOL, data JSONB);