Skip to content

Commit

Permalink
Add initial SpatiaLite ↔ PostGIS support
Browse files Browse the repository at this point in the history
  • Loading branch information
mkgrgis committed Feb 8, 2024
1 parent b50e57f commit a9fe8b6
Show file tree
Hide file tree
Showing 260 changed files with 12,260 additions and 8,188 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,8 @@ You can execute test by test.sh directly.
The version of PostgreSQL is detected automatically by $(VERSION) variable in Makefile.
The corresponding sql and expected directory will be used to compare the result. For example, for Postgres 15.0, you can execute "test.sh" directly, and the sql/15.0 and expected/15.0 will be used to compare automatically.

Test data directory is `/tmp/sqlite_fdw_test`. If you have `/tmp` mounted as `tmpfs` the tests will be up to 800% faster.

Contributing
------------

Expand Down
17 changes: 6 additions & 11 deletions connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,18 @@
*/

#include "postgres.h"

#include "sqlite_fdw.h"

#include "access/xact.h"
#include "mb/pg_wchar.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "utils/hsearch.h"
#include "commands/defrem.h"
#if (PG_VERSION_NUM >= 140000 && PG_VERSION_NUM < 150000)
#include "miscadmin.h"
#endif
#include "optimizer/cost.h"
#include "utils/builtins.h"
#include "utils/inval.h"
#include "utils/memutils.h"
#include "utils/resowner.h"
#include "utils/syscache.h"
#include "utils/builtins.h"
#include "commands/defrem.h"

/* Length of host */
#define HOST_LEN 256

/*
* Connection cache hash table entry
Expand Down
18 changes: 5 additions & 13 deletions deparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,29 @@
*/

#include "postgres.h"

#include "sqlite_fdw.h"

#include "pgtime.h"
#include "access/heapam.h"
#include "access/htup_details.h"
#include "access/sysattr.h"
#include "catalog/pg_aggregate.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_opfamily.h"
#include "catalog/pg_proc.h"
#if PG_VERSION_NUM >= 160000
#include "catalog/pg_ts_config.h"
#include "catalog/pg_ts_config.h"
#endif
#include "catalog/pg_ts_dict.h"
#include "catalog/pg_type.h"
#if (PG_VERSION_NUM < 130000)
#include "catalog/pg_type.h"
#endif
#include "commands/defrem.h"
#include "mb/pg_wchar.h"
#include "nodes/nodeFuncs.h"
#include "nodes/plannodes.h"
#include "optimizer/clauses.h"
#include "optimizer/tlist.h"
#include "parser/parsetree.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/syscache.h"
#include "utils/timestamp.h"
#include "utils/typcache.h"
#include "commands/tablecmds.h"
#include "mb/pg_wchar.h"

/*
* Global context for sqlite_foreign_expr_walker's search of an expression tree.
Expand Down
4 changes: 2 additions & 2 deletions expected/12.16/aggregate.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
CREATE EXTENSION sqlite_fdw;
--Testcase 17:
CREATE SERVER sqlite_svr FOREIGN DATA WRAPPER sqlite_fdw
OPTIONS (database '/tmp/sqlitefdw_test.db');
OPTIONS (database '/tmp/sqlite_fdw_test/common.db');
--Testcase 18:
CREATE FOREIGN TABLE multiprimary(a int, b int OPTIONS (key 'true'), c int OPTIONS(key 'true')) SERVER sqlite_svr;
-- test for aggregate pushdown
Expand All @@ -17,7 +17,7 @@ DROP EXTENSION IF EXISTS sqlite_fdw CASCADE;
CREATE EXTENSION sqlite_fdw;
--Testcase 11:
CREATE SERVER sqlite_svr FOREIGN DATA WRAPPER sqlite_fdw
OPTIONS (database '/tmp/sqlitefdw_test.db');
OPTIONS (database '/tmp/sqlite_fdw_test/common.db');
--Testcase 12:
CREATE FOREIGN TABLE multiprimary(a int, b int OPTIONS (key 'true'), c int OPTIONS(key 'true')) SERVER sqlite_svr;
--Testcase 1:
Expand Down
2 changes: 1 addition & 1 deletion expected/12.16/extra/aggregates.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
CREATE EXTENSION sqlite_fdw;
--Testcase 267:
CREATE SERVER sqlite_svr FOREIGN DATA WRAPPER sqlite_fdw
OPTIONS (database '/tmp/sqlitefdw_test_core.db');
OPTIONS (database '/tmp/sqlite_fdw_test/core.db');
--Testcase 268:
CREATE FOREIGN TABLE onek(
unique1 int4 OPTIONS (key 'true'),
Expand Down
Loading

0 comments on commit a9fe8b6

Please sign in to comment.