MCPcopy Create free account
hub / github.com/SOCI/soci / function_creator

Method function_creator

tests/postgresql/test-postgresql.cpp:197–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195{
196public:
197 explicit function_creator(soci::session & sql)
198 : sql_(sql)
199 {
200 drop();
201
202 // before a language can be used it must be defined
203 // if it has already been defined then an error will occur
204 try { sql << "create language plpgsql"; }
205 catch (soci_error const &) {} // ignore if error
206
207 sql <<
208 "create or replace function soci_test(msg varchar) "
209 "returns varchar as $$ "
210 "declare x int := 1;"
211 "begin "
212 " return msg; "
213 "end $$ language plpgsql";
214 }
215
216 ~function_creator() { drop(); }
217

Callers

nothing calls this directly

Calls 1

dropFunction · 0.85

Tested by

no test coverage detected