-
Notifications
You must be signed in to change notification settings - Fork 2
/
test_helper_functions.h
36 lines (28 loc) · 1.11 KB
/
test_helper_functions.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
/*-------------------------------------------------------------------------
*
* test_helper_functions.h
*
* Declarations for public functions and types related to unit testing
* functionality.
*
* Copyright (c) 2014, Citus Data, Inc.
*
*-------------------------------------------------------------------------
*/
#ifndef PG_SHARD_TEST_HELPER_H
#define PG_SHARD_TEST_HELPER_H
#include "postgres.h"
#include "fmgr.h"
/* SQL statements for testing */
#define POPULATE_TEMP_TABLE "CREATE TEMPORARY TABLE numbers " \
"AS SELECT * FROM generate_series(1, 100);"
#define COUNT_TEMP_TABLE "SELECT COUNT(*) FROM numbers;"
/* function declarations for exercising pg_shard functions */
extern Datum initialize_remote_temp_table(PG_FUNCTION_ARGS);
extern Datum count_remote_temp_table_rows(PG_FUNCTION_ARGS);
extern Datum get_and_purge_connection(PG_FUNCTION_ARGS);
extern Datum load_shard_id_array(PG_FUNCTION_ARGS);
extern Datum load_shard_interval_array(PG_FUNCTION_ARGS);
extern Datum load_shard_placement_array(PG_FUNCTION_ARGS);
extern Datum partition_column_id(PG_FUNCTION_ARGS);
#endif /* PG_SHARD_TEST_HELPER_H */