Skip to content

webcore-no/kt_fdw

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kyoto Tycoon Foreign Data Wrapper for PostgreSQL

Thanks to the Blackhole Foreign Data Wrapper for PostgreSQL for providing a good template of how to build FDWs for PostgreSQL.

To Build:

    make
    (sudo) make install

A note about transactional support: This FDW supports Kyoto Tycoon transactions via LUA scripts. Therefore, KT needs to be compiled with LUA support. To do this, run

./configure --enable-lua

when compiling KT.

Furthermore the ktserver has to be started with tranactions.lua loaded:

./ktserver -scr <fdw directory>/transactions.lua

If you want to disable transactions remove -DUSE_TRANSACTIONS from the Makefile in the FDW.

To Test:

make installcheck

Flags

kt_set

insert into <table name> values ('key', 'value', 'kt_set');

Makes insert overwrite existing keys in kyototycoon.

insert into <table name> values ('key', NULL, 'kt_set');

If value == NULL and the 'kt_set' flag is present. The insert acts as a delete.

kt_append

insert into <table name> values ('key', 'value', 'kt_append');

Should append 'value' to any existing value in 'key'

Usage:

CREATE SERVER <server name> FOREIGN DATA WRAPPER kt_fdw OPTIONS
(host '127.0.0.1', port '1978', timeout '-1', reconnect '1000');
(the above options are the defaults)

CREATE USER MAPPING FOR PUBLIC SERVER kt_server;

CREATE FOREIGN TABLE <table name> (key TEXT, value BYTEA, flags TEXT) SERVER <server name>;

Now you can Select, Update, Delete and Insert!

About

Kyoto Tycoon FDW for PostgreSQL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • C 86.1%
  • C++ 8.8%
  • Makefile 2.7%
  • PHP 1.5%
  • Lua 0.9%