Basic structure of the extension & package

This commit is contained in:
Javier Goizueta
2016-02-15 18:29:43 +01:00
parent 561d1282b3
commit cfd3646fc3
21 changed files with 212 additions and 1 deletions
+3
View File
@@ -0,0 +1,3 @@
dist/
test/regression.diffs
test/regression.out
+22
View File
@@ -0,0 +1,22 @@
EXTENSION = crankshaft
EXTVERSION = $(shell grep default_version $(EXTENSION).control | sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
DATA = dist/$(EXTENSION)--$(EXTVERSION).sql
SOURCES_DATA_DIR = sql
SOURCES_DATA = $(wildcard sql/$(EXTVERSION)/*.sql)
dist/$(EXTENSION)--$(EXTVERSION).sql: $(SOURCES_DATA)
rm -f $@
cat $(SOURCES_DATA_DIR)/*.sql >> $@
dist/$(EXTENSION).control: $(EXTENSION).control
cp $< $@
REGRESS = $(notdir $(basename $(wildcard test/sql/*test.sql)))
TEST_DIR = test
REGRESS_OPTS = --inputdir='$(TEST_DIR)' --outputdir='$(TEST_DIR)'
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
+7
View File
@@ -0,0 +1,7 @@
# Running the tests:
```
sudo make install
PGUSER=postgres make installcheck
```
+5
View File
@@ -0,0 +1,5 @@
comment = 'CartoDB Spatial Analysis extension'
default_version = '0.0.1'
requires = 'plpythonu'
superuser = true
schema = cdb_crankshaft
+5
View File
@@ -0,0 +1,5 @@
CREATE OR REPLACE FUNCTION cdb_poc_xyz()
RETURNS Text AS $$
from crankshaft.poc import xyz
return xyz()
$$ LANGUAGE plpythonu;
+4
View File
@@ -0,0 +1,4 @@
-- Install dependencies
CREATE EXTENSION plpythonu;
-- Install the extension
CREATE EXTENSION crankshaft;
+6
View File
@@ -0,0 +1,6 @@
SELECT cdb_crankshaft.cdb_poc_xyz();
cdb_poc_xyz
-------------
xyz-result
(1 row)
+4
View File
@@ -0,0 +1,4 @@
-- Install dependencies
CREATE EXTENSION plpythonu;
-- Install the extension
CREATE EXTENSION crankshaft;
+6
View File
@@ -0,0 +1,6 @@
SELECT cdb_crankshaft.cdb_poc_xyz();
cdb_poc_xyz
-------------
xyz-result
(1 row)
+5
View File
@@ -0,0 +1,5 @@
-- Install dependencies
CREATE EXTENSION plpythonu;
-- Install the extension
CREATE EXTENSION crankshaft;
+1
View File
@@ -0,0 +1 @@
SELECT cdb_crankshaft.cdb_poc_xyz();