diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2024-05-07 16:30:20 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2024-05-07 16:52:07 +0300 |
commit | 14ea58b7c2f240d90d90e6c841c6eb42bb0c39bb (patch) | |
tree | 08d880b6979c86fce17e254073f4c743a3d101e8 | |
parent | 4b59d1f83f387374430bd58e109ba1c082a27766 (diff) |
Add odb-examples package to repository
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | libodb-mssql/manifest | 15 | ||||
-rw-r--r-- | libodb-mysql/manifest | 20 | ||||
-rw-r--r-- | libodb-oracle/manifest | 14 | ||||
-rw-r--r-- | libodb-pgsql/manifest | 20 | ||||
-rw-r--r-- | libodb-sqlite/manifest | 10 | ||||
-rw-r--r-- | libodb/manifest | 20 | ||||
-rw-r--r-- | odb-examples/LICENSE | 2 | ||||
l--------- | odb-examples/NEWS | 1 | ||||
-rw-r--r-- | odb-tests/build/root.build | 6 | ||||
-rw-r--r-- | odb-tests/common/access/buildfile | 2 | ||||
-rw-r--r-- | odb-tests/common/prepared/buildfile | 8 | ||||
-rw-r--r-- | packages.manifest | 2 |
13 files changed, 105 insertions, 25 deletions
@@ -45,11 +45,11 @@ bdep config create @oracle ../odb-oracle cc config.cxx=g++ bdep config create @mssql ../odb-mssql cc config.cxx=g++ bdep init @host -d odb -bdep init @sqlite -d libodb -d libodb-sqlite -d odb-tests -bdep init @pgsql -d libodb -d libodb-pgsql -d odb-tests -bdep init @mysql -d libodb -d libodb-mysql -d odb-tests -bdep init @oracle -d libodb -d libodb-oracle -d odb-tests -bdep init @mssql -d libodb -d libodb-mssql -d odb-tests +bdep init @sqlite -d libodb -d libodb-sqlite -d odb-tests -d odb-examples +bdep init @pgsql -d libodb -d libodb-pgsql -d odb-tests -d odb-examples +bdep init @mysql -d libodb -d libodb-mysql -d odb-tests -d odb-examples +bdep init @oracle -d libodb -d libodb-oracle -d odb-tests -d odb-examples +bdep init @mssql -d libodb -d libodb-mssql -d odb-tests -d odb-examples ``` Note that while the target configurations can use any compiler (and you can diff --git a/libodb-mssql/manifest b/libodb-mssql/manifest index 9d4c165..aed17ea 100644 --- a/libodb-mssql/manifest +++ b/libodb-mssql/manifest @@ -28,6 +28,9 @@ depends: * cli ^1.2.0- ? ($config.libodb_mssql.develop) tests: odb-tests == $ \ ? (!$defined(config.odb_tests.database)) config.odb_tests.database=mssql +examples: odb-examples == $ \ + ? (!$defined(config.odb_examples.database)) config.odb_examples.database=mssql + # Note: common for all the build configurations. # build-auxiliary: *-mssql_* @@ -37,7 +40,8 @@ build-auxiliary: *-mssql_* # builds: none ; Requires proprietary software. -# Instead of the default configuration (see odb-tests for background). +# Instead of the default configuration (see odb-{tests,examples} for +# background). # custom-builds: latest ; Requires proprietary software. custom-builds: &( +( +windows &msvc ) +( +linux &gcc ) ) ; Only test on Windows and Linux with main compiler. @@ -53,6 +57,15 @@ custom-build-config: config.odb_tests.mssql.port=$getenv(DATABASE_PORT) config.odb_tests.mssql.driver=$getenv(MSSQL_ODBC_DRIVER) }+ odb-tests + +{ + config.odb_examples.mssql.user=$getenv(DATABASE_USER) + config.odb_examples.mssql.passwd=$getenv(DATABASE_PASSWORD) + config.odb_examples.mssql.database=$getenv(DATABASE_NAME) + config.odb_examples.mssql.host=$getenv(DATABASE_HOST) + config.odb_examples.mssql.port=$getenv(DATABASE_PORT) + config.odb_examples.mssql.driver=$getenv(MSSQL_ODBC_DRIVER) +}+ odb-examples \ # Instead of the multi configuration (see odb-tests for background). diff --git a/libodb-mysql/manifest b/libodb-mysql/manifest index bbb673a..54fb612 100644 --- a/libodb-mysql/manifest +++ b/libodb-mysql/manifest @@ -28,6 +28,9 @@ depends: * cli ^1.2.0- ? ($config.libodb_mysql.develop) tests: odb-tests == $ \ ? (!$defined(config.odb_tests.database)) config.odb_tests.database=mysql +examples: odb-examples == $ \ + ? (!$defined(config.odb_examples.database)) config.odb_examples.database=mysql + # Note: common for all the build configurations. # build-auxiliary: *-mysql_* @@ -42,6 +45,13 @@ default-build-config: config.odb_tests.mysql.host=$getenv(DATABASE_HOST) config.odb_tests.mysql.port=$getenv(DATABASE_PORT) }+ odb-tests + +{ + config.odb_examples.mysql.user=$getenv(DATABASE_USER) + config.odb_examples.mysql.database=$getenv(DATABASE_NAME) + config.odb_examples.mysql.host=$getenv(DATABASE_HOST) + config.odb_examples.mysql.port=$getenv(DATABASE_PORT) +}+ odb-examples \ # Only build this package configuration where it can be tested via odb-tests @@ -65,7 +75,8 @@ multi-build-config: }+ odb-tests \ -# Complements the default configuration (see odb-tests for background). +# Complements the default configuration (see odb-{tests,examples} for +# background). # custom-builds: latest ; Requires latest config with GCC as host compiler. custom-builds: -wasm @@ -79,6 +90,13 @@ custom-build-config: config.odb_tests.mysql.host=$getenv(DATABASE_HOST) config.odb_tests.mysql.port=$getenv(DATABASE_PORT) }+ odb-tests + +{ + config.odb_examples.mysql.user=$getenv(DATABASE_USER) + config.odb_examples.mysql.database=$getenv(DATABASE_NAME) + config.odb_examples.mysql.host=$getenv(DATABASE_HOST) + config.odb_examples.mysql.port=$getenv(DATABASE_PORT) +}+ odb-examples \ # Complements the multi configuration (see odb-tests for background). diff --git a/libodb-oracle/manifest b/libodb-oracle/manifest index be49894..66c1c00 100644 --- a/libodb-oracle/manifest +++ b/libodb-oracle/manifest @@ -27,6 +27,9 @@ depends: * cli ^1.2.0- ? ($config.libodb_oracle.develop) tests: odb-tests == $ \ ? (!$defined(config.odb_tests.database)) config.odb_tests.database=oracle +examples: odb-examples == $ \ + ? (!$defined(config.odb_examples.database)) config.odb_examples.database=oracle + # Note: common for all the build configurations. # build-auxiliary: *-oracle_* @@ -36,7 +39,8 @@ build-auxiliary: *-oracle_* # builds: none ; Requires proprietary software. -# Instead of the default configuration (see odb-tests for background). +# Instead of the default configuration (see odb-{tests,examples} for +# background). # custom-builds: latest ; Requires proprietary software. custom-builds: &( +linux &gcc ) ; Only test on Linux with main compiler. @@ -51,6 +55,14 @@ custom-build-config: config.odb_tests.oracle.port=$getenv(DATABASE_PORT) config.odb_tests.oracle.service=$getenv(DATABASE_SERVICE) }+ odb-tests + +{ + config.odb_examples.oracle.user=$getenv(DATABASE_USER) + config.odb_examples.oracle.passwd=$getenv(DATABASE_PASSWORD) + config.odb_examples.oracle.host=$getenv(DATABASE_HOST) + config.odb_examples.oracle.port=$getenv(DATABASE_PORT) + config.odb_examples.oracle.service=$getenv(DATABASE_SERVICE) +}+ odb-examples \ # Instead of the multi configuration (see odb-tests for background). diff --git a/libodb-pgsql/manifest b/libodb-pgsql/manifest index 2f30598..4ca0bc8 100644 --- a/libodb-pgsql/manifest +++ b/libodb-pgsql/manifest @@ -27,6 +27,9 @@ depends: * cli ^1.2.0- ? ($config.libodb_pgsql.develop) tests: odb-tests == $ \ ? (!$defined(config.odb_tests.database)) config.odb_tests.database=pgsql +examples: odb-examples == $ \ + ? (!$defined(config.odb_examples.database)) config.odb_examples.database=pgsql + # Note: common for all the build configurations. # build-auxiliary: *-postgresql_* @@ -41,6 +44,13 @@ default-build-config: config.odb_tests.pgsql.host=$getenv(DATABASE_HOST) config.odb_tests.pgsql.port=$getenv(DATABASE_PORT) }+ odb-tests + +{ + config.odb_examples.pgsql.user=$getenv(DATABASE_USER) + config.odb_examples.pgsql.database=$getenv(DATABASE_NAME) + config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) + config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) +}+ odb-examples \ # Only build this package configuration where it can be tested via odb-tests @@ -64,7 +74,8 @@ multi-build-config: }+ odb-tests \ -# Complements the default configuration (see odb-tests for background). +# Complements the default configuration (see odb-{tests,examples} for +# background). # custom-builds: latest ; Requires latest config with GCC as host compiler. custom-builds: -wasm @@ -78,6 +89,13 @@ custom-build-config: config.odb_tests.pgsql.host=$getenv(DATABASE_HOST) config.odb_tests.pgsql.port=$getenv(DATABASE_PORT) }+ odb-tests + +{ + config.odb_examples.pgsql.user=$getenv(DATABASE_USER) + config.odb_examples.pgsql.database=$getenv(DATABASE_NAME) + config.odb_examples.pgsql.host=$getenv(DATABASE_HOST) + config.odb_examples.pgsql.port=$getenv(DATABASE_PORT) +}+ odb-examples \ # Complements the multi configuration (see odb-tests for background). diff --git a/libodb-sqlite/manifest b/libodb-sqlite/manifest index d4464af..5da8e88 100644 --- a/libodb-sqlite/manifest +++ b/libodb-sqlite/manifest @@ -27,6 +27,9 @@ depends: * cli ^1.2.0- ? ($config.libodb_sqlite.develop) tests: odb-tests == $ \ ? (!$defined(config.odb_tests.database)) config.odb_tests.database=sqlite +examples: odb-examples == $ \ + ? (!$defined(config.odb_examples.database)) config.odb_examples.database=sqlite + builds: all # Only build this package configuration where it can be tested via odb-tests @@ -39,15 +42,16 @@ multi-builds: &gcc-5+ ; Requires GCC 5 or later. multi-builds: -static ; Implementation uses plugins and requires -fPIC. multi-build-config: { config.odb_tests.multi_database=true }+ odb-tests -# Complements the default configuration (see odb-tests for background). +# Complements the default configuration (see odb-{tests,examples} for +# background). # -custom-builds: latest ; Requires latest config with GCC as host compiler. +custom-builds: latest ; Requires latest config with GCC as host compiler. custom-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-build-bot: -- see below. # Complements the multi configuration (see odb-tests for background). # -custom-multi-builds: latest ; Requires latest config with GCC as host compiler. +custom-multi-builds: latest ; Requires latest config with GCC as host compiler. custom-multi-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-multi-build-bot: -- see below. custom-multi-build-config: { config.odb_tests.multi_database=true }+ odb-tests diff --git a/libodb/manifest b/libodb/manifest index b063729..6052338 100644 --- a/libodb/manifest +++ b/libodb/manifest @@ -20,15 +20,21 @@ requires: c++11 depends: * build2 >= 0.16.0- depends: * bpkg >= 0.16.0- -tests: odb-tests == $ ? ($config.odb_tests.libodb_test) +tests: odb-tests == $ ? ($config.odb_tests.libodb_test) +examples: odb-examples == $ ? ($config.odb_examples.libodb_example) -builds: all +default-builds: all default-build-config: \ { config.odb_tests.libodb_test=true config.odb_tests.database=sqlite }+ odb-tests + +{ + config.odb_examples.libodb_example=true + config.odb_examples.database=sqlite +}+ odb-examples \ # Only build this package configuration where it can be tested via odb-tests @@ -61,9 +67,10 @@ multi-build-config: }+ odb-tests \ -# Complements the default configuration (see odb-tests for background). +# Complements the default configuration (see odb-{tests,examples} for +# background). # -custom-builds: latest ; Requires latest config with GCC as host compiler. +custom-builds: latest ; Requires latest config with GCC as host compiler. custom-builds: -static ; Implementation uses plugins and requires -fPIC. #custom-build-bot: -- see below. custom-build-config: @@ -72,6 +79,11 @@ custom-build-config: config.odb_tests.libodb_test=true config.odb_tests.database=sqlite }+ odb-tests + +{ + config.odb_examples.libodb_example=true + config.odb_examples.database=sqlite +}+ odb-examples \ # Complements the multi configuration (see odb-tests for background). diff --git a/odb-examples/LICENSE b/odb-examples/LICENSE index 9d92da1..d96b938 100644 --- a/odb-examples/LICENSE +++ b/odb-examples/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2024 Code Synthesis Tools CC. +Copyright (c) 2009-2024 Code Synthesis. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as diff --git a/odb-examples/NEWS b/odb-examples/NEWS new file mode 120000 index 0000000..0fae0f8 --- /dev/null +++ b/odb-examples/NEWS @@ -0,0 +1 @@ +../NEWS
\ No newline at end of file diff --git a/odb-tests/build/root.build b/odb-tests/build/root.build index 40efec0..fafbfca 100644 --- a/odb-tests/build/root.build +++ b/odb-tests/build/root.build @@ -396,9 +396,9 @@ if! $skeleton test.target = $cxx.target } -# The helper targets which can be used as prerequisites of test drivers -# which require either a specific database client or multiple clients for -# all the enabled databases. +# The helper targets which can be used as prerequisites of test drivers which +# require either a specific database client or multiple clients for all the +# enabled databases. # alias{mysql-client}: $mysql_client: { diff --git a/odb-tests/common/access/buildfile b/odb-tests/common/access/buildfile index f1264d9..cbdcab7 100644 --- a/odb-tests/common/access/buildfile +++ b/odb-tests/common/access/buildfile @@ -30,7 +30,7 @@ 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 access_ \ +odb_options = --table-prefix t_access_ \ --generate-schema \ --accessor-regex '#(.+)#Get\u\1#' \ --modifier-regex '#(.+)#Set\u\1#' diff --git a/odb-tests/common/prepared/buildfile b/odb-tests/common/prepared/buildfile index 4006a4f..56a0074 100644 --- a/odb-tests/common/prepared/buildfile +++ b/odb-tests/common/prepared/buildfile @@ -30,10 +30,10 @@ 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 prepared_ \ - --generate-schema \ - --generate-query \ - --generate-prepared \ +odb_options = --table-prefix t_prepared_ \ + --generate-schema \ + --generate-query \ + --generate-prepared \ --omit-unprepared cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/packages.manifest b/packages.manifest index 95df333..2352b84 100644 --- a/packages.manifest +++ b/packages.manifest @@ -18,3 +18,5 @@ location: libodb-boost/ location: libodb-qt/ : location: odb-tests/ +: +location: odb-examples/ |