Start of the ingest SP
authorMike Rylander <mrylander@gmail.com>
Sun, 3 Mar 2013 22:44:31 +0000 (17:44 -0500)
committerMike Rylander <mrylander@gmail.com>
Sun, 3 Mar 2013 22:44:31 +0000 (17:44 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>

src/sql/004.schema.repository.sql

index 3db06c8..c2a9331 100644 (file)
@@ -121,5 +121,14 @@ CREATE TABLE depository.item_field (
     CONSTRAINT  item_or_container CHECK (COALESCE(item,container) IS NOT NULL)
 );
 
+CREATE OR REPLACE FUNCTION depository.ingest_item () RETURNS TRIGGER AS $F$
+    use JSON::XS;
+    my $json = shift();
+    my $struct = JSON::XS->new->allow_nonref->decode( $_TD->{new}{data} );
+
+    
+$F$ LANGUAGE PLPERLU;
+
+
 COMMIT;