test-postgresql.cpp
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 //
7 
8 #include "soci.h"
9 #include "soci-postgresql.h"
10 #include "common-tests.h"
11 #include <iostream>
12 #include <sstream>
13 #include <string>
14 #include <cassert>
15 #include <cmath>
16 #include <cstring>
17 #include <ctime>
18 #include <cstdlib>
19 
20 using namespace soci;
21 using namespace soci::tests;
22 
23 std::string connectString;
25 
26 // Postgres-specific tests
27 
29 {
31  : table_creator_base(sql)
32  {
33  sql << "create table soci_test ("
34  " id integer,"
35  " name varchar(100)"
36  ") with oids";
37  }
38 };
39 
40 // ROWID test
41 // Note: in PostgreSQL, there is no ROWID, there is OID.
42 // It is still provided as a separate type for "portability",
43 // whatever that means.
44 void test1()
45 {
46  try
47  {
48  session sql(backEnd, connectString);
49 
50  oid_table_creator tableCreator(sql);
51 
52  sql << "insert into soci_test(id, name) values(7, \'John\')";
53 
54  rowid rid(sql);
55  sql << "select oid from soci_test where id = 7", into(rid);
56 
57  int id;
58  std::string name;
59 
60 #ifndef SOCI_POSTGRESQL_NOPARAMS
61 
62  sql << "select id, name from soci_test where oid = :rid",
63  into(id), into(name), use(rid);
64 
65 #else
66  // Older PostgreSQL does not support use elements.
67 
69  = static_cast<postgresql_rowid_backend *>(rid.get_backend());
70 
71  unsigned long oid = rbe->value_;
72 
73  sql << "select id, name from soci_test where oid = " << oid,
74  into(id), into(name);
75 
76 #endif // SOCI_POSTGRESQL_NOPARAMS
77 
78  assert(id == 7);
79  assert(name == "John");
80 
81  // Must not cause the application to crash.
82  statement st(sql);
83  st.prepare(""); // Throws an exception in some versions.
84  }
85  catch(...)
86  {
87  }
88  std::cout << "test 1 passed" << std::endl;
89 }
90 
91 // function call test
93 {
94 public:
95 
98  {
99  // before a language can be used it must be defined
100  // if it has already been defined then an error will occur
101  try { sql << "create language plpgsql"; }
102  catch (soci_error const &) {} // ignore if error
103 
104 #ifndef SOCI_POSTGRESQL_NOPARAMS
105 
106  sql <<
107  "create or replace function soci_test(msg varchar) "
108  "returns varchar as $$ "
109  "declare x int := 1;"
110  "begin "
111  " return msg; "
112  "end $$ language plpgsql";
113 #else
114 
115  sql <<
116  "create or replace function soci_test(varchar) "
117  "returns varchar as \' "
118  "declare x int := 1;"
119  "begin "
120  " return $1; "
121  "end \' language plpgsql";
122 #endif
123  }
124 
125 protected:
126 
127  std::string drop_statement()
128  {
129  return "drop function soci_test(varchar)";
130  }
131 };
132 
133 void test2()
134 {
135  {
136  session sql(backEnd, connectString);
137 
138  function_creator functionCreator(sql);
139 
140  std::string in("my message");
141  std::string out;
142 
143 #ifndef SOCI_POSTGRESQL_NOPARAMS
144 
145  statement st = (sql.prepare <<
146  "select soci_test(:input)",
147  into(out),
148  use(in, "input"));
149 
150 #else
151  // Older PostgreSQL does not support use elements.
152 
153  statement st = (sql.prepare <<
154  "select soci_test(\'" << in << "\')",
155  into(out));
156 
157 #endif // SOCI_POSTGRESQL_NOPARAMS
158 
159  st.execute(true);
160  assert(out == in);
161 
162  // explicit procedure syntax
163  {
164  std::string in("my message2");
165  std::string out;
166 
167 #ifndef SOCI_POSTGRESQL_NOPARAMS
168 
169  procedure proc = (sql.prepare <<
170  "soci_test(:input)",
171  into(out), use(in, "input"));
172 
173 #else
174  // Older PostgreSQL does not support use elements.
175 
176  procedure proc = (sql.prepare <<
177  "soci_test(\'" << in << "\')", into(out));
178 
179 #endif // SOCI_POSTGRESQL_NOPARAMS
180 
181  proc.execute(true);
182  assert(out == in);
183  }
184  }
185 
186  std::cout << "test 2 passed" << std::endl;
187 }
188 
189 // BLOB test
191 {
193  : table_creator_base(sql)
194  {
195  sql <<
196  "create table soci_test ("
197  " id integer,"
198  " img oid"
199  ")";
200  }
201 };
202 
203 void test3()
204 {
205  {
206  session sql(backEnd, connectString);
207 
208  blob_table_creator tableCreator(sql);
209 
210  char buf[] = "abcdefghijklmnopqrstuvwxyz";
211 
212  sql << "insert into soci_test(id, img) values(7, lo_creat(-1))";
213 
214  // in PostgreSQL, BLOB operations must be within transaction block
215  transaction tr(sql);
216 
217  {
218  blob b(sql);
219 
220  sql << "select img from soci_test where id = 7", into(b);
221  assert(b.get_len() == 0);
222 
223  b.write(0, buf, sizeof(buf));
224  assert(b.get_len() == sizeof(buf));
225 
226  b.append(buf, sizeof(buf));
227  assert(b.get_len() == 2 * sizeof(buf));
228  }
229  {
230  blob b(sql);
231  sql << "select img from soci_test where id = 7", into(b);
232  assert(b.get_len() == 2 * sizeof(buf));
233  char buf2[100];
234  b.read(0, buf2, 10);
235  assert(std::strncmp(buf2, "abcdefghij", 10) == 0);
236  }
237 
238  unsigned long oid;
239  sql << "select img from soci_test where id = 7", into(oid);
240  sql << "select lo_unlink(" << oid << ")";
241  }
242 
243  std::cout << "test 3 passed" << std::endl;
244 }
245 
247 {
249  : table_creator_base(sql)
250  {
251  sql << "create table soci_test(val int8)";
252  }
253 };
254 
255 // long long test
256 void test4()
257 {
258  {
259  session sql(backEnd, connectString);
260 
261  longlong_table_creator tableCreator(sql);
262 
263  long long v1 = 1000000000000LL;
264  assert(v1 / 1000000 == 1000000);
265 
266  sql << "insert into soci_test(val) values(:val)", use(v1);
267 
268  long long v2 = 0LL;
269  sql << "select val from soci_test", into(v2);
270 
271  assert(v2 == v1);
272  }
273 
274  // vector<long long>
275  {
276  session sql(backEnd, connectString);
277 
278  longlong_table_creator tableCreator(sql);
279 
280  std::vector<long long> v1;
281  v1.push_back(1000000000000LL);
282  v1.push_back(1000000000001LL);
283  v1.push_back(1000000000002LL);
284  v1.push_back(1000000000003LL);
285  v1.push_back(1000000000004LL);
286 
287  sql << "insert into soci_test(val) values(:val)", use(v1);
288 
289  std::vector<long long> v2(10);
290  sql << "select val from soci_test order by val desc", into(v2);
291 
292  assert(v2.size() == 5);
293  assert(v2[0] == 1000000000004LL);
294  assert(v2[1] == 1000000000003LL);
295  assert(v2[2] == 1000000000002LL);
296  assert(v2[3] == 1000000000001LL);
297  assert(v2[4] == 1000000000000LL);
298  }
299 
300  std::cout << "test 4 passed" << std::endl;
301 }
302 
303 // unsigned long long test
304 void test4ul()
305 {
306  {
307  session sql(backEnd, connectString);
308 
309  longlong_table_creator tableCreator(sql);
310 
311  unsigned long long v1 = 1000000000000ULL;
312  assert(v1 / 1000000 == 1000000);
313 
314  sql << "insert into soci_test(val) values(:val)", use(v1);
315 
316  unsigned long long v2 = 0ULL;
317  sql << "select val from soci_test", into(v2);
318 
319  assert(v2 == v1);
320  }
321 }
322 
324 {
326  : table_creator_base(sql)
327  {
328  sql << "create table soci_test(val boolean)";
329  }
330 };
331 
332 void test5()
333 {
334  {
335  session sql(backEnd, connectString);
336 
337  boolean_table_creator tableCreator(sql);
338 
339  int i1 = 0;
340 
341  sql << "insert into soci_test(val) values(:val)", use(i1);
342 
343  int i2 = 7;
344  sql << "select val from soci_test", into(i2);
345 
346  assert(i2 == i1);
347 
348  sql << "update soci_test set val = true";
349  sql << "select val from soci_test", into(i2);
350  assert(i2 == 1);
351  }
352 
353  std::cout << "test 5 passed" << std::endl;
354 }
355 
356 // dynamic backend test
357 void test6()
358 {
359  try
360  {
361  session sql("nosuchbackend://" + connectString);
362  assert(false);
363  }
364  catch (soci_error const & e)
365  {
366  assert(e.what() == std::string("Failed to open: libsoci_nosuchbackend.so"));
367  }
368 
369  {
370  dynamic_backends::register_backend("pgsql", backEnd);
371 
372  std::vector<std::string> backends = dynamic_backends::list_all();
373  assert(backends.size() == 1);
374  assert(backends[0] == "pgsql");
375 
376  {
377  session sql("pgsql://" + connectString);
378  }
379 
380  dynamic_backends::unload("pgsql");
381 
382  backends = dynamic_backends::list_all();
383  assert(backends.empty());
384  }
385 
386  {
387  session sql("postgresql://" + connectString);
388  }
389 
390  std::cout << "test 6 passed" << std::endl;
391 }
392 
393 void test7()
394 {
395  {
396  session sql(backEnd, connectString);
397 
398  int i;
399  sql << "select 123", into(i);
400  assert(i == 123);
401 
402  try
403  {
404  sql << "select 'ABC'", into (i);
405  assert(false);
406  }
407  catch (soci_error const & e)
408  {
409  assert(e.what() == std::string("Cannot convert data."));
410  }
411  }
412 
413  std::cout << "test 7 passed" << std::endl;
414 }
415 
416 void test8()
417 {
418  {
419  session sql(backEnd, connectString);
420 
421  assert(sql.get_backend_name() == "postgresql");
422  }
423 
424  std::cout << "test 8 passed" << std::endl;
425 }
426 
427 // test for double-colon cast in SQL expressions
428 void test9()
429 {
430  {
431  session sql(backEnd, connectString);
432 
433  int a = 123;
434  int b = 0;
435  sql << "select :a::integer", use(a), into(b);
436  assert(b == a);
437  }
438 
439  std::cout << "test 9 passed" << std::endl;
440 }
441 
442 // test for date, time and timestamp parsing
443 void test10()
444 {
445  {
446  session sql(backEnd, connectString);
447 
448  std::string someDate = "2009-06-17 22:51:03.123";
449  std::tm t1, t2, t3;
450 
451  sql << "select :sd::date, :sd::time, :sd::timestamp",
452  use(someDate, "sd"), into(t1), into(t2), into(t3);
453 
454  // t1 should contain only the date part
455  assert(t1.tm_year == 2009 - 1900);
456  assert(t1.tm_mon == 6 - 1);
457  assert(t1.tm_mday == 17);
458  assert(t1.tm_hour == 0);
459  assert(t1.tm_min == 0);
460  assert(t1.tm_sec == 0);
461 
462  // t2 should contain only the time of day part
463  assert(t2.tm_year == 0);
464  assert(t2.tm_mon == 0);
465  assert(t2.tm_mday == 1);
466  assert(t2.tm_hour == 22);
467  assert(t2.tm_min == 51);
468  assert(t2.tm_sec == 3);
469 
470  // t3 should contain all information
471  assert(t3.tm_year == 2009 - 1900);
472  assert(t3.tm_mon == 6 - 1);
473  assert(t3.tm_mday == 17);
474  assert(t3.tm_hour == 22);
475  assert(t3.tm_min == 51);
476  assert(t3.tm_sec == 3);
477  }
478 
479  std::cout << "test 10 passed" << std::endl;
480 }
481 
482 // test for number of affected rows
483 
485 {
487  : table_creator_base(sql)
488  {
489  sql << "create table soci_test(val integer)";
490  }
491 };
492 
493 void test11()
494 {
495  {
496  session sql(backEnd, connectString);
497 
498  table_creator_for_test11 tableCreator(sql);
499 
500  for (int i = 0; i != 10; i++)
501  {
502  sql << "insert into soci_test(val) values(:val)", use(i);
503  }
504 
505  statement st1 = (sql.prepare <<
506  "update soci_test set val = val + 1");
507  st1.execute(false);
508 
509  assert(st1.get_affected_rows() == 10);
510 
511  statement st2 = (sql.prepare <<
512  "delete from soci_test where val <= 5");
513  st2.execute(false);
514 
515  assert(st2.get_affected_rows() == 5);
516  }
517 
518  std::cout << "test 11 passed" << std::endl;
519 }
520 
521 // test INSERT INTO ... RETURNING syntax
522 
524 {
526  : table_creator_base(sql)
527  {
528  sql << "create table soci_test(sid serial, txt text)";
529  }
530 };
531 
532 void test12()
533 {
534  {
535  session sql(backEnd, connectString);
536 
537  table_creator_for_test12 tableCreator(sql);
538 
539  std::vector<long> ids(10);
540  for (std::size_t i = 0; i != ids.size(); i++)
541  {
542  long sid(0);
543  std::string txt("abc");
544  sql << "insert into soci_test(txt) values(:txt) returning sid", use(txt, "txt"), into(sid);
545  ids[i] = sid;
546  }
547 
548  std::vector<long> ids2(ids.size());
549  sql << "select sid from soci_test order by sid", into(ids2);
550  assert(std::equal(ids.begin(), ids.end(), ids2.begin()));
551  }
552 
553  std::cout << "test 12 passed" << std::endl;
554 }
555 
557 {
559  : table_creator_base(sql)
560  {
561  sql << "drop table if exists soci_test;";
562  sql << "create table soci_test ( val bytea null )";
563  }
564 };
565 
567 {
568  {
569  session sql(backEnd, connectString);
570  bytea_table_creator tableCreator(sql);
571 
572  int v = 0x0A0B0C0D;
573  unsigned char* b = reinterpret_cast<unsigned char*>(&v);
574  std::string data;
575  std::copy(b, b + sizeof(v), std::back_inserter(data));
576  {
577 
578  sql << "insert into soci_test(val) values(:val)", use(data);
579 
580  // 1) into string, no Oid mapping
581  std::string bin1;
582  sql << "select val from soci_test", into(bin1);
583  assert(bin1 == "\\x0d0c0b0a");
584 
585  // 2) Oid-to-dt_string mapped
586  row r;
587  sql << "select * from soci_test", into(r);
588 
589  assert(r.size() == 1);
590  column_properties const& props = r.get_properties(0);
591  assert(props.get_data_type() == soci::dt_string);
592  std::string bin2 = r.get<std::string>(0);
593  assert(bin2 == "\\x0d0c0b0a");
594  }
595  }
596  std::cout << "test bytea passed" << std::endl;
597 }
598 
599 // json
601 {
603  : table_creator_base(sql)
604  {
605  sql << "drop table if exists soci_json_test;";
606  sql << "create table soci_json_test(data json)";
607  }
608 };
609 
610 // Return 9,2 for 9.2.3
611 typedef std::pair<int,int> server_version;
612 
614 {
615  std::string version;
616  std::pair<int,int> result;
617  sql << "select version()",into(version);
618  if (sscanf(version.c_str(),"PostgreSQL %i.%i", &result.first, &result.second) < 2)
619  {
620  throw std::runtime_error("Failed to retrieve PostgreSQL version number");
621  }
622  return result;
623 }
624 
625 // Test JSON. Only valid for PostgreSQL Server 9.2++
626 void test_json()
627 {
628  session sql(backEnd, connectString);
629  server_version version = get_postgresql_version(sql);
630  if ( version >= server_version(9,2))
631  {
632  bool exception = false;
633  std::string result;
634  std::string valid_input = "{\"tool\":\"soci\",\"result\":42}";
635  std::string invalid_input = "{\"tool\":\"other\",\"result\":invalid}";
636 
637  table_creator_json tableCreator(sql);
638 
639  sql << "insert into soci_json_test (data) values(:data)",use(valid_input);
640  sql << "select data from soci_json_test",into(result);
641  assert(result == valid_input);
642 
643  try
644  {
645  sql << "insert into soci_json_test (data) values(:data)",use(invalid_input);
646  }
647  catch(soci_error& e)
648  {
649  (void)e;
650  exception = true;
651  }
652  assert(exception);
653  std::cout << "test json passed" << std::endl;
654  }
655  else
656  {
657  std::cout << "test json skipped (PostgreSQL >= 9.2 required, found " << version.first << "." << version.second << ")" << std::endl;
658  }
659 }
660 
662 {
664  {
665  sql << "drop table if exists soci_test;";
666  sql << "create table soci_test(name varchar(20))";
667  }
668 };
669 
670 // Test deallocate_prepared_statement called for non-existing statement
671 // which creation failed due to invalid SQL syntax.
672 // https://github.com/SOCI/soci/issues/116
674 {
675  {
676  session sql(backEnd, connectString);
677  table_creator_text tableCreator(sql);
678 
679  try
680  {
681  // types mismatch should lead to PQprepare failure
682  statement get_trades =
683  (sql.prepare
684  << "select * from soci_test where name=9999");
685  assert(false);
686  }
687  catch(soci_error const& e)
688  {
689  std::string const msg(e.what());
690  // poor-man heuristics
691  assert(msg.find("prepared statement") == std::string::npos);
692  assert(msg.find("operator does not exist") != std::string::npos);
693  }
694  }
695  std::cout << "test_statement_prepare_failure passed" << std::endl;
696 }
697 
698 // Test the support of PostgreSQL-style casts with ORM
700 {
701  session sql(backEnd, connectString);
702  values v;
703  v.set("a", 1);
704  sql << "select :a::int", use(v); // Must not throw an exception!
705 }
706 
708 {
710  : table_creator_base(sql)
711  {
712  sql << "create table soci_test(val uuid)";
713  }
714 };
715 
716 void try_one_uuid_format(session& sql, const std::string& uuid, const std::string& uuidExpected)
717 {
718  sql << "insert into soci_test(val) values(:val)", use(uuid);
719 
720  // 1) into string, no Oid mapping
721  std::string uuid1;
722  sql << "select val from soci_test", into(uuid1);
723  assert(uuid1 == uuidExpected);
724 
725  // 2) Oid-to-dt_string mapped
726  row r;
727  sql << "select * from soci_test", into(r);
728 
729  assert(r.size() == 1);
730  column_properties const& props = r.get_properties(0);
731  assert(props.get_data_type() == soci::dt_string);
732  std::string uuid2 = r.get<std::string>(0);
733  assert(uuid2 == uuidExpected);
734 }
735 
737 {
738  {
739  session sql(backEnd, connectString);
741 
742  static const std::string standardUuid("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11");
743  std::vector<std::string> uuidFormats;
744 
745  uuidFormats.push_back(standardUuid);
746  uuidFormats.push_back("A0EEBC99-9C0B-4EF8-BB6D-6BB9BD380A11");
747  uuidFormats.push_back("{a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11}");
748  uuidFormats.push_back("a0eebc999c0b4ef8bb6d6bb9bd380a11");
749  uuidFormats.push_back("a0ee-bc99-9c0b-4ef8-bb6d-6bb9-bd38-0a11");
750  uuidFormats.push_back("{a0eebc99-9c0b4ef8-bb6d6bb9-bd380a11}");
751 
752  std::vector<std::string>::const_iterator it = uuidFormats.begin();
753  while (it != uuidFormats.end())
754  {
755  std::string uuid = *it++;
756  try_one_uuid_format(sql, uuid, standardUuid);
757  }
758  }
759  std::cout << "test uuid passed" << std::endl;
760 }
761 
762 //
763 // Support for soci Common Tests
764 //
765 
766 // DDL Creation objects for common tests
768 {
770  : table_creator_base(sql)
771  {
772  sql << "create table soci_test(id integer, val integer, c char, "
773  "str varchar(20), sh int2, ul numeric(20), d float8, "
774  "tm timestamp, i1 integer, i2 integer, i3 integer, "
775  "name varchar(20))";
776  }
777 };
778 
780 {
782  : table_creator_base(sql)
783  {
784  sql << "create table soci_test(num_float float8, num_int integer,"
785  " name varchar(20), sometime timestamp, chr char)";
786  }
787 };
788 
790 {
792  : table_creator_base(sql)
793  {
794  sql << "create table soci_test(name varchar(100) not null, "
795  "phone varchar(15))";
796  }
797 };
798 
800 {
802  : table_creator_base(sql)
803  {
804  sql << "create table soci_test(val integer)";
805  }
806 };
807 
808 // Common tests context
809 class test_context : public test_context_base
810 {
811 public:
812  test_context(backend_factory const &backEnd, std::string const &connectString)
813  : test_context_base(backEnd, connectString)
814  {}
815 
817  {
818  return new table_creator_one(s);
819  }
820 
822  {
823  return new table_creator_two(s);
824  }
825 
827  {
828  return new table_creator_three(s);
829  }
830 
832  {
834  }
835 
836  std::string to_date_time(std::string const &datdt_string) const
837  {
838  return "timestamptz(\'" + datdt_string + "\')";
839  }
840 };
841 
842 int main(int argc, char** argv)
843 {
844 
845 #ifdef _MSC_VER
846  // Redirect errors, unrecoverable problems, and assert() failures to STDERR,
847  // instead of debug message window.
848  // This hack is required to run asser()-driven tests by Buildbot.
849  // NOTE: Comment this 2 lines for debugging with Visual C++ debugger to catch assertions inside.
850  _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
851  _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
852 #endif //_MSC_VER
853 
854  if (argc == 2)
855  {
856  connectString = argv[1];
857  }
858  else
859  {
860  std::cout << "usage: " << argv[0]
861  << " connectstring\n"
862  << "example: " << argv[0]
863  << " \'connect_string_for_PostgreSQL\'\n";
864  return EXIT_FAILURE;
865  }
866 
867  try
868  {
869  test_context tc(backEnd, connectString);
870  common_tests tests(tc);
871  tests.run();
872 
873  std::cout << "\nSOCI PostgreSQL Tests:\n\n";
874  test1();
875  test2();
876  test3();
877  test4();
878  test4ul();
879  test5();
880  //test6();
881  std::cout << "test 6 skipped (dynamic backend)\n";
882  test7();
883  test8();
884  test9();
885  test10();
886  test11();
887  test12();
888  test_bytea();
889  test_json();
891  test_orm_cast();
893 
894  std::cout << "\nOK, all tests passed.\n\n";
895 
896  return EXIT_SUCCESS;
897  }
898  catch (std::exception const & e)
899  {
900  std::cout << e.what() << '\n';
901  }
902  return EXIT_FAILURE;
903 }
column_properties const & get_properties(std::size_t pos) const
Definition: row.cpp:91
void test_uuid_column_type_support()
void test5()
T get(std::size_t pos) const
Definition: row.h:66
details::into_container< T, details::no_indicator > into(T &t)
Definition: into.h:51
void test8()
void set(std::string const &name, T const &value, indicator indic=i_ok)
Definition: values.h:166
test_context(backend_factory const &backEnd, std::string const &connectString)
table_creator_for_test12(session &sql)
SOCI_DECL std::vector< std::string > list_all()
void test12()
table_creator_base * table_creator_2(session &s) const
void run(bool dbSupportsTransactions=true)
Definition: common-tests.h:293
void test3()
std::string get_backend_name() const
void test4()
void test2()
Definition: row.h:41
backend_factory const & backEnd
std::size_t size() const
Definition: row.cpp:60
details::rowid_backend * get_backend()
Definition: rowid.h:33
int main(int argc, char **argv)
std::size_t read(std::size_t offset, char *buf, std::size_t toRead)
Definition: core/blob.cpp:31
void try_one_uuid_format(session &sql, const std::string &uuid, const std::string &uuidExpected)
void test9()
table_creator_for_test11(session &sql)
table_creator_one(session &sql)
std::string connectString
SOCI_DECL void register_backend(std::string const &name, std::string const &shared_object=std::string())
void test7()
table_creator_base * table_creator_4(session &s) const
void test1()
void prepare(std::string const &query, details::statement_type eType=details::st_repeatable_query)
Definition: statement.h:200
table_creator_json(session &sql)
bool execute(bool withDataExchange=false)
Definition: procedure.h:65
void test_bytea()
blob_table_creator(session &sql)
table_creator_text(session &sql)
void test_orm_cast()
void test10()
long long get_affected_rows()
Definition: statement.h:214
SOCI_POSTGRESQL_DECL backend_factory const * factory_postgresql()
table_creator_base * table_creator_1(session &s) const
longlong_table_creator(session &sql)
std::size_t append(char const *buf, std::size_t toWrite)
Definition: core/blob.cpp:42
table_creator_base * table_creator_3(session &s) const
server_version get_postgresql_version(session &sql)
void test6()
std::string drop_statement()
function_creator(session &sql)
SOCI_DECL void unload(std::string const &name)
boolean_table_creator(session &sql)
void test4ul()
std::string to_date_time(std::string const &datdt_string) const
std::size_t get_len()
Definition: core/blob.cpp:26
oid_table_creator(session &sql)
table_creator_two(session &sql)
std::pair< int, int > server_version
void test11()
details::prepare_type prepare
Definition: session.h:69
void test_json()
table_creator_three(session &sql)
details::use_container< T, details::no_indicator > use(T &t, const std::string &name=std::string())
Definition: use.h:43
bytea_table_creator(session &sql)
void test_statement_prepare_failure()
bool execute(bool withDataExchange=false)
Definition: statement.h:208
std::size_t write(std::size_t offset, char const *buf, std::size_t toWrite)
Definition: core/blob.cpp:36


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:41