Commit Graph

22 Commits

Author SHA1 Message Date
anisimko
c75234037f Remove GNAT bug OB03-009 workaround
GNAT Community 2021 does not have this defect already.

TN: U430-004
Change-Id: Ib10b9d209a866daae7eb684f08a79b26d774dc83
2021-06-20 10:00:20 +06:00
Philippe Gil
447297292c minor refactoring to workaround accessibility checks bug.
TN:U430-004
Change-Id: Ib12c81f1c0e555c71d33c05fba3b023e3c514153
2021-05-01 18:36:20 +02:00
Fedor Rybin
33b963c5e4 Make GNATCOLL.SQL Ada 2020 compatible
Qualify the aggregate to fix compilation error in 2020 mode.

for U121-029

Change-Id: I57c0696eb01ca2ab32106c6760099a402e41910d
2021-01-22 11:22:55 +03:00
anisimko
0819d68de5 Remove unused package references
no-tn-check

GNAT style check became more strict.

Change-Id: I24b59f7b3ffdfa58d8a54b3ede6bfa56fbdcc46d
2020-09-14 11:12:41 +06:00
Fabien Chouteau
5bdd20ae4d gnatcoll_*.gpr: rename external GNATCOLL_BUILD into GNATCOLL_BUILD_MODE
To avoid conflict with installed gnatcoll.gpr where GNATCOLL_BUILD means
library type.

Part of S709-037.

Change-Id: I372b3fc7b35faf14a223465069968ff1e5550250
2020-09-10 18:42:36 +02:00
Fabien Chouteau
d9a2231ff0 gnatcoll_*.gpr: rename all external GNATCOLL_*_BUILD into GNATCOLL_BUILD
To have a unified external for all GNATCOLL project, as discussed for
gnatcoll-db.

Part of S709-037.

Change-Id: I5b6c843df6926288b8906a8c285a6d682394d7bf
2020-08-26 18:38:05 +02:00
Fabien Chouteau
b3a055d835 gnatcoll_*.gpr: introduce the GNATCOLL_*_BUILD external
Like for gnatcoll_core, these externals allow gnatcoll_*.gpr to be used
from a project that defines the BUILD external in an incompatible way.

Part of S709-037.

Change-Id: Ib69453688c4c3ea112aa8b00d3a610bdc2f5426f
2020-07-27 16:56:56 +02:00
Fabien Chouteau
afd3bbfb2f gnatcoll.gpr_{postgres|sql|sqlite|xref}: set default LIBRARY_TYPE
Part of T717-016.

Change-Id: Idd60944d984b2cf9c05759a87cd4b4bb8cc8e8b4
2020-07-17 16:46:32 +02:00
anisimko
767216d0e0 Fix sqlite2db issues
* sql/gnatcoll-sql-inspect.adb (Type_From_SQL):
For Field_Mapping_Integer does not interpret 'numeric' without precision and
scale as Integer. Add decimal type processing.
For Field_Mapping_Float interpret 'decimal' and 'numeric' without precision
and scale as Float.

* sqlite/gnatcoll-sql-sqlite-builder.adb (Foreach_Field):
Ignore square brackets in field names. Fix parsing numeric with position and
scale.

* testsuite/tests/db2ada/chinook/*
Testsuite with public database example.

TN: T627-001
Change-Id: I38843e0c1b6be144d19b9f2e7ed118c2bf44e070
2020-06-30 08:02:57 +06:00
anisimko
37cda9383c Fixes in database schema processing
* gnatcoll-sql-inspect.ads (Type_From_SQL):
Considers datetime as Field_Mapping_Timestamp.

* gnatcoll-sql-inspect.adb (Type_From_SQL):
Considers nvarchar as Field_Mapping_Text.
Parsing max length moved into separated routine Process Max_Length.

* sqlite/gnatcoll-sql-sqlite-builder.adb
(Foreach_Table): Fix SQL request over database tables. Takes only
tables and views from the sqlite_master and does not take service
SQLite tables.
(Foreach_Field): Do not interpret as field the FOREIGN/UNIQUE KEY
element in CREATE TABLE statement.

TN: T627-001
Change-Id: Ibb6ca6c6a67489bbe569c0c0b1aed2e5a9cd4b34
2020-06-27 15:54:18 +02:00
anisimko
7a8d0cf9eb Nanosecond timestamp precision for SQLite
T610-033

SQLite support nanosecond precision for timestamp.
Testsuite for SQLite subseconds.

Change-Id: Ifcf5c3d2dceb6c17153860d8d3c9a95975b837c5
2020-06-12 23:29:37 +06:00
Vasiliy Fofanov
c067251840 Fix various typos and headers, bump copyright.
Motivated by github PR #14. no-tn-check

Change-Id: I866431c55fe0937f348d08cd8a188eb40fc8f061
2020-06-12 19:29:25 +02:00
anisimko
1c9f4b7f94 Support subseconds in timestamp
T610-033

Use GNAT.Calendar.Time_IO.Image instead of Ada.Calendar.Formatting.Image
because it has better precision on subseconds.

Change-Id: I56236d55a76d208cbd611f2eb93036a98dfec830
Depend-On: I08b4190cd89284c1fc5626b80742aafc26a01175
2020-06-11 19:16:57 +06:00
anisimko
93ff96567b Fix data loading for postgres database
T315-007

SQL insert statement to load data uses select statement to take PK value by
another field value. The value in condition in generated "WHERE" part was
with wrong type specifier. The type specifier was taken from the type of FK
field instead of "another" field type.

Change-Id: I820d4c2265d831627770554a0d0226791e4dbc72
2020-03-24 19:36:14 +06:00
Dmitriy Anisimkov
b9ea5f28f9 Fix default name to prepare statement
T315-007

Generate Cached_Result field before check Name parameter to do not use
No_Cache_Id for all automatically assigned parepared statement names.

Change-Id: I91c2928cc803da1beae11a26ce3f1e92dc99b875
2020-03-20 23:46:20 +06:00
Dmitriy Anisimkov
de57885c91 Support prepare on server control
T315-007

(Is_Prepared_On_Server): New routine to know if the statement was prepared
on server side.

Change-Id: Ibb26c0d2b737d942bab7eef4dd7b073b44c76796
2020-03-20 18:40:40 +01:00
Dmitriy Anisimkov
1eb83958a0 Add Length routine for SQL_Field_List
Comment Is_Empty routine

Change-Id: I61b8e764d815f773334c3e162b58a2c06a853149
2018-06-04 16:01:10 +06:00
Dmitriy Anisimkov
98263a4fd6 Get_Tables new routine
R510-007

Convert SQL_Table_List to tables vector. Can be used to extend set of Joined
tables.

Change-Id: I15f8a668b1475c1bf385c30ffc9d6d3e4c32e4eb
2018-05-16 16:14:03 +06:00
Pierre-Marie de Rodat
22f18fb3b2 Disable parallelism in Makefiles
(no-tn-check)

Change-Id: Iccd88aad5fa9a3e2e8b61ed060d7cb1f0549f8bb
2018-05-09 16:21:59 +02:00
Dmitriy Anisimkov
b66441cce0 Create body for some expression functions
R411-015

Because GNAT became checking unreferenced parameter for expression functions
but did not provide a way to mark it unchecked in this state.

Change-Id: I8b5b65bb2701a989dd000aeb56290322c982a61e
2018-04-12 10:19:57 +02:00
Nicolas Roche
9e196abb0d Review makefile and project file
Part of R314-019

Change-Id: I3c83968fa5b8e61716599399c8fa9642c699b6b3
2018-03-28 16:11:59 +02:00
Dmitriy Anisimkov
5a40249df9 Move GNATCOLL.SQL from gnatcoll-core
R314-019

Change-Id: I3c91eb31c5f93b632dccb4f16bafe498dbeaf7de
2018-03-28 19:07:56 +06:00