SQLite Foreign Data Wrapper for PostgreSQL
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
expected
sql Support column_name option Dec 4, 2018
.gitignore Initial commit Apr 9, 2018
License
META.json
Makefile
README.md
connection.c
deparse.c
option.c
sqlite_fdw--1.0.sql
sqlite_fdw.c
sqlite_fdw.control
sqlite_fdw.h
sqlite_query.c
test.sh

README.md

SQLite Foreign Data Wrapper for PostgreSQL

This PostgreSQL extension is a Foreign Data Wrapper for SQLite.
The current version can work with PostgreSQL 9.6, 10 and 11.

1. Installation

1. Install SQLite library

For debian or ubuntu:

apt-get install libsqlite3-dev

You can also download SQLite source code and build SQLite.

2. Build and install sqlite_fdw

Add a directory of pg_config to PATH and build and install sqlite_fdw.

make USE_PGXS=1
make install USE_PGXS=1

If you want to build sqlite_fdw in a source tree of PostgreSQL, use

make
make install

2. Usage

Load extension

CREATE EXTENSION sqlite_fdw;

Create server

Please specify SQLite database path using database option:

CREATE SERVER sqlite_server FOREIGN DATA WRAPPER sqlite_fdw OPTIONS (database '/tmp/test.db');

Create foreign table

CREATE FOREIGN TABLE t1(a integer, b text) SERVER sqlite_server OPTIONS (table 't1_sqlite');

Import foreign schema

IMPORT FOREIGN SCHEMA public FROM SERVER sqlite_server INTO public;

Access foregin table

SELECT * FROM t1;

3. Features

  • Support update to foreign table
  • WHERE clauses are pushdowned
  • Aggregate function are pushdowned
  • Transactions

4. Limitations

Nothing.

5. Contributing

Opening issues and pull requests on GitHub are welcome.

6. License

Copyright (c) 2017-2018, TOSHIBA Corporation
Copyright (c) 2011 - 2016, EnterpriseDB Corporation

Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.

See the LICENSE file for full details.