diff options
Diffstat (limited to 'common/view')
-rw-r--r-- | common/view/basics/buildfile | 42 | ||||
-rw-r--r-- | common/view/basics/driver.cxx | 42 | ||||
-rw-r--r-- | common/view/basics/makefile | 117 | ||||
-rw-r--r-- | common/view/basics/test.hxx | 26 | ||||
-rw-r--r-- | common/view/basics/test.std | 0 | ||||
-rw-r--r-- | common/view/basics/testscript | 33 | ||||
-rw-r--r-- | common/view/olv/.gitignore | 46 | ||||
-rw-r--r-- | common/view/olv/buildfile | 50 | ||||
-rw-r--r-- | common/view/olv/driver.cxx | 36 | ||||
-rw-r--r-- | common/view/olv/makefile | 114 | ||||
-rw-r--r-- | common/view/olv/test.std | 0 | ||||
-rw-r--r-- | common/view/olv/testscript | 39 |
12 files changed, 286 insertions, 259 deletions
diff --git a/common/view/basics/buildfile b/common/view/basics/buildfile new file mode 100644 index 0000000..d9738a4 --- /dev/null +++ b/common/view/basics/buildfile @@ -0,0 +1,42 @@ +# file : common/view/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_view_b_ \ + --generate-schema \ + --generate-query \ + --generate-prepared + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/view/basics/driver.cxx b/common/view/basics/driver.cxx index d55e7c5..e2f611a 100644 --- a/common/view/basics/driver.cxx +++ b/common/view/basics/driver.cxx @@ -4,19 +4,21 @@ // Test view basics. // -#include <memory> // std::auto_ptr -#include <cassert> +#include <memory> // std::unique_ptr #include <iostream> #include <odb/database.hxx> #include <odb/transaction.hxx> -#include <common/common.hxx> -#include <common/config.hxx> // DATABASE_XXX +#include <libcommon/common.hxx> +#include <libcommon/config.hxx> // DATABASE_XXX #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include <cassert> + using namespace std; using namespace odb::core; @@ -41,7 +43,7 @@ view1_check (odb::result<V>& r) template <typename V> void -view2_test (const auto_ptr<database>& db) +view2_test (const unique_ptr<database>& db) { typedef odb::query<V> query; typedef odb::result<V> result; @@ -76,12 +78,12 @@ view2_test (const auto_ptr<database>& db) } { - auto_ptr<V> v (db->query_one<V> ()); + unique_ptr<V> v (db->query_one<V> ()); assert (v->count == 4); } { - auto_ptr<V> v; + unique_ptr<V> v; if (db->id () != odb::id_oracle) v.reset (db->query_one<V> ("age < 31")); else @@ -90,7 +92,7 @@ view2_test (const auto_ptr<database>& db) } { - auto_ptr<V> v (db->query_one<V> (query::age < 31)); + unique_ptr<V> v (db->query_one<V> (query::age < 31)); assert (v->count == 2); } @@ -99,7 +101,7 @@ view2_test (const auto_ptr<database>& db) template <typename V> void -view4_test (const auto_ptr<database>& db) +view4_test (const unique_ptr<database>& db) { typedef odb::query<V> query; typedef odb::result<V> result; @@ -162,7 +164,7 @@ view4_test (const auto_ptr<database>& db) template <typename V> void -view6_test (const auto_ptr<database>& db, const odb::query<V>& q) +view6_test (const unique_ptr<database>& db, const odb::query<V>& q) { typedef odb::result<V> result; typedef typename result::iterator iterator; @@ -193,7 +195,7 @@ main (int argc, char* argv[]) { try { - auto_ptr<database> db (create_database (argc, argv)); + unique_ptr<database> db (create_database (argc, argv)); // // @@ -309,7 +311,7 @@ main (int argc, char* argv[]) // No native parameter support in dynamic multi-database mode. // -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE { typedef odb::query<view1b> query; @@ -487,7 +489,7 @@ main (int argc, char* argv[]) // No native parameter support in dynamic multi-database mode. // -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE view6_test<view6c> ( #ifndef DATABASE_ORACLE db, "e.name = " + odb::query<view6c>::_val ("Simple Tech, Inc")); @@ -719,7 +721,12 @@ main (int argc, char* argv[]) t.commit (); } -#if !defined(DATABASE_SQLITE) && !defined(DATABASE_COMMON) + // @@ BUILD2 Also disable for DATABASE_MYSQL and DATABASE_PGSQL (see + // vright definition for details). + // +#if !defined(DATABASE_MYSQL) && \ + !defined(DATABASE_SQLITE) && \ + !defined(DATABASE_PGSQL) { typedef odb::query<vright> query; typedef odb::result<vright> result; @@ -736,9 +743,12 @@ main (int argc, char* argv[]) } #endif -#if !defined(DATABASE_MYSQL) && \ + // @@ BUILD2 Also disable for DATABASE_PGSQL (see vfull definition for + // details). + // +#if !defined(DATABASE_MYSQL) && \ !defined(DATABASE_SQLITE) && \ - !defined(DATABASE_COMMON) + !defined(DATABASE_PGSQL) { typedef odb::query<vfull> query; typedef odb::result<vfull> result; diff --git a/common/view/basics/makefile b/common/view/basics/makefile deleted file mode 100644 index eafe550..0000000 --- a/common/view/basics/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/view/basics/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-prepared --table-prefix t_view_b_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx index 66bf86c..130bcd4 100644 --- a/common/view/basics/test.hxx +++ b/common/view/basics/test.hxx @@ -543,7 +543,18 @@ namespace test2 odb::nullable<int> id2; }; -#if !defined(ODB_DATABASE_SQLITE) && !defined(ODB_DATABASE_COMMON) + // @@ BUILD2 Also disable for ODB_DATABASE_MYSQL and ODB_DATABASE_PGSQL, + // otherwise we end up with the following error: + // + // test-odb-mysql.hxx:3202:20: error: invalid use of incomplete type ‘class odb::access::view_traits<test2::vright>’ + // 3202 | public access::view_traits< ::test2::vright > + // | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // +//#if !defined(ODB_DATABASE_SQLITE) && !defined(ODB_DATABASE_COMMON) +#if !defined(ODB_DATABASE_MYSQL) && \ + !defined(ODB_DATABASE_SQLITE) && \ + !defined(ODB_DATABASE_PGSQL) && \ + !defined(ODB_DATABASE_COMMON) #pragma db view object(obj2 = o2) object(obj1 = o1 right: o2::n == o1::n) struct vright @@ -554,8 +565,21 @@ namespace test2 #endif + // @@ BUILD2 Also disable for ODB_DATABASE_PGSQL, otherwise we end up with the + // following error: + // + // test-odb-pgsql.hxx:3325:20: error: invalid use of incomplete type ‘class odb::access::view_traits<test2::vfull>’ + // 3325 | public access::view_traits< ::test2::vfull > + // | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // +/* +#if !defined(ODB_DATABASE_MYSQL) && \ + !defined(ODB_DATABASE_SQLITE) && \ + !defined(ODB_DATABASE_COMMON) +*/ #if !defined(ODB_DATABASE_MYSQL) && \ !defined(ODB_DATABASE_SQLITE) && \ + !defined(ODB_DATABASE_PGSQL) && \ !defined(ODB_DATABASE_COMMON) #pragma db view object(obj1 = o1) object(obj2 = o2 full: o1::n == o2::n) diff --git a/common/view/basics/test.std b/common/view/basics/test.std deleted file mode 100644 index e69de29..0000000 --- a/common/view/basics/test.std +++ /dev/null diff --git a/common/view/basics/testscript b/common/view/basics/testscript new file mode 100644 index 0000000..faa8408 --- /dev/null +++ b/common/view/basics/testscript @@ -0,0 +1,33 @@ +# file : common/view/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/view/olv/.gitignore b/common/view/olv/.gitignore new file mode 100644 index 0000000..2b95165 --- /dev/null +++ b/common/view/olv/.gitignore @@ -0,0 +1,46 @@ +# ODB-generated files. +# +test1-odb.?xx +test1-odb-*.?xx +test1.sql +test1-*.sql + +test2-odb.?xx +test2-odb-*.?xx +test2.sql +test2-*.sql + +test3-odb.?xx +test3-odb-*.?xx +test3.sql +test3-*.sql + +test4-odb.?xx +test4-odb-*.?xx +test4.sql +test4-*.sql + +test5-odb.?xx +test5-odb-*.?xx +test5.sql +test5-*.sql + +test6-odb.?xx +test6-odb-*.?xx +test6.sql +test6-*.sql + +test7-odb.?xx +test7-odb-*.?xx +test7.sql +test7-*.sql + +test8-odb.?xx +test8-odb-*.?xx +test8.sql +test8-*.sql + +test9-odb.?xx +test9-odb-*.?xx +test9.sql +test9-*.sql diff --git a/common/view/olv/buildfile b/common/view/olv/buildfile new file mode 100644 index 0000000..89ecbcf --- /dev/null +++ b/common/view/olv/buildfile @@ -0,0 +1,50 @@ +# file : common/view/olv/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +hs = test1 test2 test3 test4 test5 test6 test7 test8 test9 + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +for h: $hs +{ + exe{driver}: {hxx ixx cxx}{$h-odb} + + <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} + + for db: $databases + { + exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi + <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} + } +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_view_olv_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc + +testscript@./: schemas = $hs diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx index c417cc3..c08015e 100644 --- a/common/view/olv/driver.cxx +++ b/common/view/olv/driver.cxx @@ -4,8 +4,7 @@ // Test object loading views. // -#include <memory> // std::auto_ptr -#include <cassert> +#include <memory> // std::unique_ptr #include <iostream> #include <typeinfo> @@ -13,7 +12,7 @@ #include <odb/database.hxx> #include <odb/transaction.hxx> -#include <common/common.hxx> +#include <libcommon/common.hxx> #include "test1.hxx" #include "test2.hxx" @@ -35,6 +34,9 @@ #include "test8-odb.hxx" #include "test9-odb.hxx" +#undef NDEBUG +#include <cassert> + using namespace std; using namespace odb::core; @@ -43,7 +45,7 @@ main (int argc, char* argv[]) { try { - auto_ptr<database> db (create_database (argc, argv)); + unique_ptr<database> db (create_database (argc, argv)); // Test basic object loading functionality. // @@ -365,7 +367,15 @@ main (int argc, char* argv[]) transaction t (db->begin ()); session s; view2 v (db->query_value<view2> ()); - assert (v.o1.n == 123 && v.o2.s == "abc" && v.o2.o1 == &v.o1); + + // @@ BUILD2 As of cl 19.29.30136 (VS 2019 16.11.5) v.o2.o1 points to + // the address of o1 member of the object being returned by + // query_value<view2>() which v is a copy of, and thus the + // original assertion fails. Note that changing `view2 v` to + // `const view2& v` doesn't help. + // + //assert (v.o1.n == 123 && v.o2.s == "abc" && v.o2.o1 == &v.o1); + assert (v.o1.n == 123 && v.o2.s == "abc"); t.commit (); } @@ -588,20 +598,23 @@ main (int argc, char* argv[]) // { view1r r (db->query_value<view1r> (query<view1r>::n == 1)); - assert (r.n == 1 && r.o->n == 1 && typeid (*r.o) == typeid (root)); + auto& o (*r.o); + assert (r.n == 1 && r.o->n == 1 && typeid (o) == typeid (root)); } { view1r r (db->query_value<view1r> (query<view1r>::n == 2)); - assert (r.n == 2 && r.o->n == 2 && typeid (*r.o) == typeid (base)); + auto& o (*r.o); + assert (r.n == 2 && r.o->n == 2 && typeid (o) == typeid (base)); base& b (dynamic_cast<base&> (*r.o)); assert (b.s == "a"); } { view1r r (db->query_value<view1r> (query<view1r>::n == 3)); - assert (r.n == 3 && r.o->n == 3 && typeid (*r.o) == typeid (derived)); - derived& d (dynamic_cast<derived&> (*r.o)); + auto& o (*r.o); + assert (r.n == 3 && r.o->n == 3 && typeid (o) == typeid (derived)); + derived& d (dynamic_cast<derived&> (o)); assert (d.s == "b" && d.b); } @@ -614,9 +627,10 @@ main (int argc, char* argv[]) { view1b r (db->query_value<view1b> (query<view1b>::n == 3)); + auto& o (*r.o); assert (r.s == "b" && r.n == 3 && r.o->n == 3 && - typeid (*r.o) == typeid (derived)); - derived& d (dynamic_cast<derived&> (*r.o)); + typeid (o) == typeid (derived)); + derived& d (dynamic_cast<derived&> (o)); assert (d.s == "b" && d.b); } diff --git a/common/view/olv/makefile b/common/view/olv/makefile deleted file mode 100644 index c65d7e9..0000000 --- a/common/view/olv/makefile +++ /dev/null @@ -1,114 +0,0 @@ -# file : common/view/olv/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx test4.hxx test5.hxx test6.hxx \ -test7.hxx test8.hxx test9.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix t_view_olv_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export odb_header_stem := $(basename $(odb_hdr)) -$(dist): export extra_dist := $(data_dist) $(call vc10projs,$(name)) \ -$(call vc11projs,$(name)) $(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule,,$(filter %.sql,$(gen)))) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d,$(filter %.sql,$(gen))))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/view/olv/test.std b/common/view/olv/test.std deleted file mode 100644 index e69de29..0000000 --- a/common/view/olv/test.std +++ /dev/null diff --git a/common/view/olv/testscript b/common/view/olv/testscript new file mode 100644 index 0000000..160426d --- /dev/null +++ b/common/view/olv/testscript @@ -0,0 +1,39 @@ +# file : common/view/olv/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql-schema.testscript + + for s: $schemas + cat $out_base/"$s"($multi ? '-mysql' : '').sql | $create_schema_cmd + end; + + $* ($multi ? 'mysql' : ) $mysql_options +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql-schema.testscript + + for s: $schemas + $create_schema_cmd -f $out_base/"$s"($multi ? '-pgsql' : '').sql + end; + + $* ($multi ? 'pgsql' : ) $pgsql_options +} |