85.4 KB
/srv/reproducible-results/rbuild-debian/r-b-build.h0esQTE8/b1/libgnatcoll-db_25.0.0-2_amd64.changes vs.
/srv/reproducible-results/rbuild-debian/r-b-build.h0esQTE8/b2/libgnatcoll-db_25.0.0-2_amd64.changes
1.08 KB
Files
    
Offset 1, 11 lines modifiedOffset 1, 11 lines modified
  
1 ·51bd56c8a20e0f05eefa2ef3cd931747·392600·debug·optional·libgnatcoll-db-bin-dbgsym_25.0.0-2_amd64.deb1 ·51bd56c8a20e0f05eefa2ef3cd931747·392600·debug·optional·libgnatcoll-db-bin-dbgsym_25.0.0-2_amd64.deb
2 ·9a2ebc3a6b5a174909ddf089b9df0f03·214724·devel·optional·libgnatcoll-db-bin_25.0.0-2_amd64.deb2 ·9a2ebc3a6b5a174909ddf089b9df0f03·214724·devel·optional·libgnatcoll-db-bin_25.0.0-2_amd64.deb
3 ·e50639565f99f818c7d3af4ff74d86ce·522532·doc·optional·libgnatcoll-db-doc_25.0.0-2_all.deb3 ·1663ff73c3634d9583a1de7f0fb6ccc9·523048·doc·optional·libgnatcoll-db-doc_25.0.0-2_all.deb
4 ·86afa36ebe0f3bbba03b2773a0544b79·164828·libdevel·optional·libgnatcoll-postgres-dev_25.0.0-2_amd64.deb4 ·86afa36ebe0f3bbba03b2773a0544b79·164828·libdevel·optional·libgnatcoll-postgres-dev_25.0.0-2_amd64.deb
5 ·07e268f0b5990e09406eb9c65c38a678·223432·debug·optional·libgnatcoll-postgres2-dbgsym_25.0.0-2_amd64.deb5 ·07e268f0b5990e09406eb9c65c38a678·223432·debug·optional·libgnatcoll-postgres2-dbgsym_25.0.0-2_amd64.deb
6 ·12e81d6ba47e17eea06948d0d89fa6b8·145508·libs·optional·libgnatcoll-postgres2_25.0.0-2_amd64.deb6 ·12e81d6ba47e17eea06948d0d89fa6b8·145508·libs·optional·libgnatcoll-postgres2_25.0.0-2_amd64.deb
7 ·5de2d462e2fdb1d0658555addb9e4931·1244576·libdevel·optional·libgnatcoll-sql-dev_25.0.0-2_amd64.deb7 ·5de2d462e2fdb1d0658555addb9e4931·1244576·libdevel·optional·libgnatcoll-sql-dev_25.0.0-2_amd64.deb
8 ·4d01ded5e153f0ea4d3a7daec3faaf3f·2019516·debug·optional·libgnatcoll-sql4-dbgsym_25.0.0-2_amd64.deb8 ·4d01ded5e153f0ea4d3a7daec3faaf3f·2019516·debug·optional·libgnatcoll-sql4-dbgsym_25.0.0-2_amd64.deb
9 ·2d79d94007ca5d26dcdc7bff46067d37·1095144·libs·optional·libgnatcoll-sql4_25.0.0-2_amd64.deb9 ·2d79d94007ca5d26dcdc7bff46067d37·1095144·libs·optional·libgnatcoll-sql4_25.0.0-2_amd64.deb
10 ·9ab79852341b37673e11e4c167cda6da·73988·libdevel·optional·libgnatcoll-sqlite-dev_25.0.0-2_amd64.deb10 ·9ab79852341b37673e11e4c167cda6da·73988·libdevel·optional·libgnatcoll-sqlite-dev_25.0.0-2_amd64.deb
84.1 KB
libgnatcoll-db-doc_25.0.0-2_all.deb
367 B
file list
    
Offset 1, 3 lines modifiedOffset 1, 3 lines modified
1 -rw-r--r--···0········0········0········4·2025-03-20·08:42:03.000000·debian-binary1 -rw-r--r--···0········0········0········4·2025-03-20·08:42:03.000000·debian-binary
2 -rw-r--r--···0········0········0·····1784·2025-03-20·08:42:03.000000·control.tar.xz2 -rw-r--r--···0········0········0·····1784·2025-03-20·08:42:03.000000·control.tar.xz
3 -rw-r--r--···0········0········0···520556·2025-03-20·08:42:03.000000·data.tar.xz3 -rw-r--r--···0········0········0···521072·2025-03-20·08:42:03.000000·data.tar.xz
98.0 B
control.tar.xz
70.0 B
control.tar
48.0 B
./md5sums
30.0 B
./md5sums
Files differ
83.6 KB
data.tar.xz
83.6 KB
data.tar
2.29 KB
file list
    
Offset 11, 15 lines modifiedOffset 11, 15 lines modified
11 -rw-r--r--···0·root·········(0)·root·········(0)·····1321·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/dbschema.txt11 -rw-r--r--···0·root·········(0)·root·········(0)·····1321·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/dbschema.txt
12 -rw-r--r--···0·root·········(0)·root·········(0)······463·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/default.gpr12 -rw-r--r--···0·root·········(0)·root·········(0)······463·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/default.gpr
13 -rw-r--r--···0·root·········(0)·root·········(0)······812·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/fixture.txt13 -rw-r--r--···0·root·········(0)·root·········(0)······812·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/fixture.txt
14 -rwxr-xr-x···0·root·········(0)·root·········(0)······124·2025-03-20·08:42:03.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/generate.sh14 -rwxr-xr-x···0·root·········(0)·root·········(0)······124·2025-03-20·08:42:03.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/generate.sh
15 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2025-03-20·08:42:03.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/generated/15 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2025-03-20·08:42:03.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/generated/
16 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/src/16 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/src/
17 -rw-r--r--···0·root·········(0)·root·········(0)·····7115·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/src/library.adb17 -rw-r--r--···0·root·········(0)·root·········(0)·····7115·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/src/library.adb
18 -rw-r--r--···0·root·········(0)·root·········(0)···336008·2025-03-20·08:42:03.000000·./usr/share/doc/libgnatcoll-db-doc/gnatcoll-db.pdf.gz18 -rw-r--r--···0·root·········(0)·root·········(0)···336497·2025-03-20·08:42:03.000000·./usr/share/doc/libgnatcoll-db-doc/gnatcoll-db.pdf.gz
19 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2025-03-20·08:42:03.000000·./usr/share/doc/libgnatcoll-db-doc/html/19 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2025-03-20·08:42:03.000000·./usr/share/doc/libgnatcoll-db-doc/html/
20 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2025-03-20·08:42:03.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/20 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2025-03-20·08:42:03.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/
21 -rw-r--r--···0·root·········(0)·root·········(0)·····1447·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/important.png21 -rw-r--r--···0·root·········(0)·root·········(0)·····1447·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/important.png
22 -rw-r--r--···0·root·········(0)·root·········(0)·····2247·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/note.png22 -rw-r--r--···0·root·········(0)·root·········(0)·····2247·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/note.png
23 -rw-r--r--···0·root·········(0)·root·········(0)·····2143·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/tip.png23 -rw-r--r--···0·root·········(0)·root·········(0)·····2143·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/tip.png
24 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2025-03-20·08:42:03.000000·./usr/share/doc/libgnatcoll-db-doc/html/_sources/24 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2025-03-20·08:42:03.000000·./usr/share/doc/libgnatcoll-db-doc/html/_sources/
25 -rw-r--r--···0·root·········(0)·root·········(0)······413·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/html/_sources/index.rst.txt25 -rw-r--r--···0·root·········(0)·root·········(0)······413·2023-11-06·10:21:17.000000·./usr/share/doc/libgnatcoll-db-doc/html/_sources/index.rst.txt
81.3 KB
./usr/share/doc/libgnatcoll-db-doc/gnatcoll-db.pdf.gz
81.1 KB
gnatcoll-db.pdf
81.1 KB
pdftotext {} -
    
Offset 16, 15 lines modifiedOffset 16, 15 lines modified
16 1.3·Database·schema·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.16 1.3·Database·schema·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.
17 1.4·The·gnatcoll_db2ada·tool·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.17 1.4·The·gnatcoll_db2ada·tool·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.
18 1.4.118 1.4.1
19 Default·output·of·gnatcoll_db2ada·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.19 Default·output·of·gnatcoll_db2ada·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.
20 1.4.220 1.4.2
21 database·introspection·in·Ada·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.21 database·introspection·in·Ada·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.
22 1.4.322 1.4.3
23 Back·to·the·library·example...·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.23 Back·to·the·library·example.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.
24 1.5·Connecting·to·the·database·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.24 1.5·Connecting·to·the·database·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.
25 1.6·Loading·initial·data·in·the·database·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.25 1.6·Loading·initial·data·in·the·database·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.
26 1.7·Writing·queries·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.26 1.7·Writing·queries·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.
27 1.8·Executing·queries·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.27 1.8·Executing·queries·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.
28 1.9·Prepared·queries·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.28 1.9·Prepared·queries·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.
29 1.10·Getting·results·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.29 1.10·Getting·results·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.
30 1.11·Creating·your·own·SQL·types·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.30 1.11·Creating·your·own·SQL·types·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.
Offset 102, 25 lines modifiedOffset 102, 25 lines modified
102 two·systems.·For·instance,·development·could·be·done·using·a·local·sqlite·DBMS,·and·then·deployed·(after102 two·systems.·For·instance,·development·could·be·done·using·a·local·sqlite·DBMS,·and·then·deployed·(after
103 testing,·of·course!)·on·a·PostgreSQL·system.103 testing,·of·course!)·on·a·PostgreSQL·system.
104 The·code·in·GNATColl·is·such·that·adding·support·for·a·new·DBMS·should·be·relatively·easy.104 The·code·in·GNATColl·is·such·that·adding·support·for·a·new·DBMS·should·be·relatively·easy.
105 ·A·place·where·an·application·stores·its·data.·The·term·database·in·this·document·refers·to·this·meaning.·In·a105 ·A·place·where·an·application·stores·its·data.·The·term·database·in·this·document·refers·to·this·meaning.·In·a
106 relational·database,·this·place·is·organized·into·tables,·each·of·which·contains·a·number·of·fields.·A·row·in·a106 relational·database,·this·place·is·organized·into·tables,·each·of·which·contains·a·number·of·fields.·A·row·in·a
107 table·represents·one·object.·The·set·of·tables·and·their·fields·is·called·the·schema·of·the·database.107 table·represents·one·object.·The·set·of·tables·and·their·fields·is·called·the·schema·of·the·database.
108 Traditionally,·writing·the·SQL·queries·is·done·inline:·special·markers·are·inserted·into·your·code·to·delimit·sections108 Traditionally,·writing·the·SQL·queries·is·done·inline:·special·markers·are·inserted·into·your·code·to·delimit·sections
109 that·contain·SQL·code·(as·opposed·to·Ada·code),·and·these·are·then·preprocessed·to·generate·actual·code.·This·isn't109 that·contain·SQL·code·(as·opposed·to·Ada·code),·and·these·are·then·preprocessed·to·generate·actual·code.·This·isnt
110 the·approach·chosen·in·GNATColl:·there·are·several·drawbacks,·in·particular·your·code·is·no·longer·Ada·and·various110 the·approach·chosen·in·GNATColl:·there·are·several·drawbacks,·in·particular·your·code·is·no·longer·Ada·and·various
111 tools·will·choke·on·it.111 tools·will·choke·on·it.
112 The·other·usual·approach·is·to·write·the·queries·as·strings,·which·are·passed,·via·a·DBMS-specific·API,·to·the·DBMS112 The·other·usual·approach·is·to·write·the·queries·as·strings,·which·are·passed,·via·a·DBMS-specific·API,·to·the·DBMS
113 server.·This·approach·is·very·fragile:113 server.·This·approach·is·very·fragile:
114 ·The·string·might·not·contain·well-formed·SQL.·This·will·unfortunately·only·be·detected·at·run·time·when·the114 ·The·string·might·not·contain·well-formed·SQL.·This·will·unfortunately·only·be·detected·at·run·time·when·the
115 DBMS·complains.115 DBMS·complains.
116 ·This·is·not·type·safe.·You·might·be·comparing·a·text·field·with·an·integer,·for·instance.·In·some·cases,·the·DBMS116 ·This·is·not·type·safe.·You·might·be·comparing·a·text·field·with·an·integer,·for·instance.·In·some·cases,·the·DBMS
117 will·accept·that·(sqlite·for·instance),·but·in·some·other·cases·it·won't·(PostgreSQL).·The·result·might·then·either117 will·accept·that·(sqlite·for·instance),·but·in·some·other·cases·it·wont·(PostgreSQL).·The·result·might·then·either
118 raise·an·error,·or·return·an·empty·list.118 raise·an·error,·or·return·an·empty·list.
119 ·There·is·a·risk·of·SQL·injection.·Assuming·the·string·is·constructed·dynamically·(using·Ada's·&·operator),·it119 ·There·is·a·risk·of·SQL·injection.·Assuming·the·string·is·constructed·dynamically·(using·Adas·&·operator),·it
120 might·be·easy·for·a·user·to·pass·a·string·that·breaks·the·query,·and·even·destroys·things·in·the·database.120 might·be·easy·for·a·user·to·pass·a·string·that·breaks·the·query,·and·even·destroys·things·in·the·database.
121 ·As·discussed·previously,·the·SQL·code·might·not·be·portable·across·DBMS.·For·instance,·creating·an·automatically·increment·integer·primary·key·in·a·table·is·DBMS·specific.121 ·As·discussed·previously,·the·SQL·code·might·not·be·portable·across·DBMS.·For·instance,·creating·an·automatically·increment·integer·primary·key·in·a·table·is·DBMS·specific.
122 ·The·string·is·fragile·if·the·database·schema·changes.·Finding·whether·a·schema·change·impacts·any·of·the122 ·The·string·is·fragile·if·the·database·schema·changes.·Finding·whether·a·schema·change·impacts·any·of·the
123 queries·requires·looking·at·all·the·strings·in·your·application.123 queries·requires·looking·at·all·the·strings·in·your·application.
124 ·performance·might·be·an·issue.·Whenever·you·execute·a·query,·the·DBMS·will·analyze·it,·decide·how·to·execute124 ·performance·might·be·an·issue.·Whenever·you·execute·a·query,·the·DBMS·will·analyze·it,·decide·how·to·execute
125 it·(for·instance,·whether·it·should·traverse·all·the·rows·of·a·table,·or·whether·it·can·do·a·faster·lookup),·and·then125 it·(for·instance,·whether·it·should·traverse·all·the·rows·of·a·table,·or·whether·it·can·do·a·faster·lookup),·and·then
  
Offset 178, 124 lines modifiedOffset 178, 125 lines modified
178 Chapter·1.·SQL:·Database·interface178 Chapter·1.·SQL:·Database·interface
  
179 \xcGNATCOLL·Documentation·-·Database·packages,·Release·0.0179 \xcGNATCOLL·Documentation·-·Database·packages,·Release·0.0
  
180 1.2·Database·example180 1.2·Database·example
181 This·section·describes·an·example·that·will·be·extended·throughout·this·chapter.·We·will·build·an·application·that181 This·section·describes·an·example·that·will·be·extended·throughout·this·chapter.·We·will·build·an·application·that
182 represents·a·library.·Such·a·library·contains·various·media·(books·and·DVDs·for·instance),·and·customers.·A·customer182 represents·a·library.·Such·a·library·contains·various·media·(books·and·DVDs·for·instance),·and·customers.·A·customer
183 can·borrow·multiple·media·at·the·same·time,·but·a·media·is·either·at·a·customer's,·or·still·in·the·library.183 can·borrow·multiple·media·at·the·same·time,·but·a·media·is·either·at·a·customers,·or·still·in·the·library.
184 The·GNATColl·distribution·includes·an·example·directory·which·contains·all·the·code·and·data·for·this·example.184 The·GNATColl·distribution·includes·an·example·directory·which·contains·all·the·code·and·data·for·this·example.
  
185 1.3·Database·schema185 1.3·Database·schema
186 As·was·mentioned·earlier·(Database·Abstraction·Layers),·GNATColl·relies·on·automatic·code·generation·to·provide·a186 As·was·mentioned·earlier·(Database·Abstraction·Layers),·GNATColl·relies·on·automatic·code·generation·to·provide·a
187 type·safe·interface·to·your·database.·This·code·is·generated·by·an·external·tool·called·gnatcoll_db2ada.·In·some·cases,187 type·safe·interface·to·your·database.·This·code·is·generated·by·an·external·tool·called·gnatcoll_db2ada.·In·some·cases,
188 this·tool·requires·an·installation·of·python·(www.python.org)·on·your·machine,·since·part·of·the·code·is·written·in·that188 this·tool·requires·an·installation·of·python·(www.python.org)·on·your·machine,·since·part·of·the·code·is·written·in·that
189 language.189 language.
190 This·tool·is·able·to·output·various·kind·of·information,·and·will·be·fully·described·later·(The·gnatcoll_db2ada·tool).190 This·tool·is·able·to·output·various·kind·of·information,·and·will·be·fully·described·later·(The·gnatcoll_db2ada·tool).
191 However,·the·input·is·always·the·same:·this·is·the·schema·of·your·database,·that·is·the·list·of·tables·and·fields·that·make191 However,·the·input·is·always·the·same:·this·is·the·schema·of·your·database,·that·is·the·list·of·tables·and·fields·that·make
192 up·your·database.·There·exist·two·ways·to·provide·that·information:192 up·your·database.·There·exist·two·ways·to·provide·that·information:
193 ·From·a·running·database193 ·From·a·running·database
194 If·you·pass·the·DBMS·vendor·(postgresql,·sqlite,...)·and·the·connection·parameters·to·gnatcoll_db2ada,·it·is194 If·you·pass·the·DBMS·vendor·(postgresql,·sqlite,.·.·.·)·and·the·connection·parameters·to·gnatcoll_db2ada,·it·is
195 able·to·query·the·schema·on·its·own.·However,·this·should·not·be·the·preferred·method:·this·is·similar·to·reverse195 able·to·query·the·schema·on·its·own.·However,·this·should·not·be·the·preferred·method:·this·is·similar·to·reverse
196 engineering·assembly·code·into·the·original·high-level·code,·and·some·semantic·information·will·be·missing.·For196 engineering·assembly·code·into·the·original·high-level·code,·and·some·semantic·information·will·be·missing.·For
197 instance,·in·SQL·we·have·to·create·tables·just·to·represent·the·many-to-many·relationships.·These·extra·tables197 instance,·in·SQL·we·have·to·create·tables·just·to·represent·the·many-to-many·relationships.·These·extra·tables
198 are·part·of·the·implementation·of·the·schema,·but·are·just·noise·when·it·comes·to·the·semantics·of·the·schema.198 are·part·of·the·implementation·of·the·schema,·but·are·just·noise·when·it·comes·to·the·semantics·of·the·schema.
199 For·this·reason,·it·is·better·to·use·the·second·solution·below:199 For·this·reason,·it·is·better·to·use·the·second·solution·below:
200 ·From·a·textual·description200 ·From·a·textual·description
201 Using·the·-dbmodel·switch·to·gnatcoll_db2ada,·you·can·pass·a·file·that·describes·the·schema.·We·do·not·use201 Using·the·-dbmodel·switch·to·gnatcoll_db2ada,·you·can·pass·a·file·that·describes·the·schema.·We·do·not·use
202 SQL·as·the·syntax·in·this,·because·as·explained·above·this·is·too·low-level.·This·text·file·also·provides·additional202 SQL·as·the·syntax·in·this,·because·as·explained·above·this·is·too·low-level.·This·text·file·also·provides·additional
203 capabilities·that·do·not·exist·when·reverse-engineering·an·existing·database,·for·instance·the·ability·to·use·name203 capabilities·that·do·not·exist·when·reverse-engineering·an·existing·database,·for·instance·the·ability·to·use·name
204 to·represent·reverse·relationships·for·foreign·keys·(see·below·and·the·ORM).204 to·represent·reverse·relationships·for·foreign·keys·(see·below·and·the·ORM).
205 The·most·convenient·editor·for·this·file·is·Emacs,·using·the·org-mode·which·provides·convenient·key·shortcuts205 The·most·convenient·editor·for·this·file·is·Emacs,·using·the·org-mode·which·provides·convenient·key·shortcuts
206 for·editing·the·contents·of·ASCII·tables.·But·any·text·editor·will·do,·and·you·do·not·need·to·align·the·columns·in206 for·editing·the·contents·of·ASCII·tables.·But·any·text·editor·will·do,·and·you·do·not·need·to·align·the·columns·in
207 this·file.207 this·file.
208 All·lines·starting·with·a·hash·sign·('#')·will·be·ignored.208 All·lines·starting·with·a·hash·sign·(#)·will·be·ignored.
209 This·file·is·a·collection·of·ASCII·tables,·each·of·which·relates·to·one·table·or·one·SQL·view·in·your·database.209 This·file·is·a·collection·of·ASCII·tables,·each·of·which·relates·to·one·table·or·one·SQL·view·in·your·database.
210 The·paragraphs·start·with·a·line·containing:210 The·paragraphs·start·with·a·line·containing:
211 table·::=211 table·::=
212 '|'·('ABSTRACT')?·('TABLE'|'VIEW')·['('·supertable·')']212 '|'·('ABSTRACT')?·('TABLE'|'VIEW')·['('·supertable·')']
213 '|'·<name>·'|'·<name_row>213 '|'·<name>·'|'·<name_row>
214 "name"·is·the·name·of·the·table.·The·third·pipe·and·third·column·are·optional,·and·should·be·used·to·specify·the214 name·is·the·name·of·the·table.·The·third·pipe·and·third·column·are·optional,·and·should·be·used·to·specify·the
215 name·for·the·element·represented·by·a·single·row.·For·instance,·if·the·table·is·called·"books",·the·third·column215 name·for·the·element·represented·by·a·single·row.·For·instance,·if·the·table·is·called·books,·the·third·column
216 could·contain·"book".·This·is·used·when·generating·objects·for·use·with·GNATCOLL.SQL.ORM.216 could·contain·book.·This·is·used·when·generating·objects·for·use·with·GNATCOLL.SQL.ORM.
217 If·the·first·line·starts·with·the·keyword·ABSTRACT,·then·no·instance·of·that·table·actually·exists·in·the·database.217 If·the·first·line·starts·with·the·keyword·ABSTRACT,·then·no·instance·of·that·table·actually·exists·in·the·database.
218 This·is·used·in·the·context·of·table·inheritance,·so·define·shared·fields·only·once·among·multiple·tables.218 This·is·used·in·the·context·of·table·inheritance,·so·define·shared·fields·only·once·among·multiple·tables.
219 The·keyword·TABLE·can·be·followed·by·the·name·of·a·table·from·which·it·inherits·the·fields.·Currently,·that219 The·keyword·TABLE·can·be·followed·by·the·name·of·a·table·from·which·it·inherits·the·fields.·Currently,·that
220 supertable·must·be·abstract,·and·the·fields·declared·in·that·table·are·simply·duplicated·in·the·new·table.220 supertable·must·be·abstract,·and·the·fields·declared·in·that·table·are·simply·duplicated·in·the·new·table.
  
221 1.2.·Database·example221 1.2.·Database·example
  
222 3222 3
  
223 \xcGNATCOLL·Documentation·-·Database·packages,·Release·0.0223 \xcGNATCOLL·Documentation·-·Database·packages,·Release·0.0
  
224 Following·the·declaration·of·the·table,·the·file·then·describe·their·fields,·each·on·a·separate·line.·Each·of·these224 Following·the·declaration·of·the·table,·the·file·then·describe·their·fields,·each·on·a·separate·line.·Each·of·these
225 lines·must·start·with·a·pipe·character·("|"),·and·contain·a·number·of·pipe-separated·fields.·The·order·of·the·fields225 lines·must·start·with·a·pipe·character·(|),·and·contain·a·number·of·pipe-separated·fields.·The·order·of·the·fields
226 is·always·given·by·the·following·grammar:226 is·always·given·by·the·following·grammar:
227 fields·::=227 fields·::=
228 '|'·<name>·'|'·<type>228 '|'·<name>·'|'·<type>
229 '|'·('PK'|''|'NULL'|'NOT·NULL'|'INDEX'|'UNIQUE'|'NOCASE')229 '|'·('PK'|''|'NULL'|'NOT·NULL'|'INDEX'|'UNIQUE'|'NOCASE')
230 '|'·[default]·'|'·[doc]·'|'230 '|'·[default]·'|'·[doc]·'|'
231 The·type·of·the·field·is·the·SQL·type·("INTEGER",·"TEXT",·"TIMESTAMP",·"DATE",·"DOUBLE·PRECISION",·"MONEY",·"BOOLEAN",·"TIME",·"CHARACTER(1)").·Any·maximal·length·can·be·specified·for231 The·type·of·the·field·is·the·SQL·type·(INTEGER,·TEXT,·TIMESTAMP,·DATE,·DOUBLE·PRECISION,·MONEY,·BOOLEAN,·TIME,·CHARACTER(1)).·Any·maximal·length·can·be·specified·for
232 strings,·not·just·1·as·in·this·example.·The·tool·will·automatically·convert·these·to·Ada·when·generating·Ada232 strings,·not·just·1·as·in·this·example.·The·tool·will·automatically·convert·these·to·Ada·when·generating·Ada·code.
233 code.·A·special·type·("AUTOINCREMENT")·is·an·integer·that·is·automatically·incremented·according·to·available·ids·in·the·table.·The·exact·type·used·will·depend·on·the·specific·DBMS.233 A·special·type·(AUTOINCREMENT)·is·an·integer·that·is·automatically·incremented·according·to·available·ids
 234 in·the·table.·The·exact·type·used·will·depend·on·the·specific·DBMS.
234 The·property·'NOCASE'·indicates·that·comparison·should·be·case·insensitive·for·this·field.235 The·property·NOCASE·indicates·that·comparison·should·be·case·insensitive·for·this·field.
235 If·the·field·is·a·foreign·key·(that·is·a·value·that·must·correspond·to·a·row·in·another·table),·you·can·use·the·special236 If·the·field·is·a·foreign·key·(that·is·a·value·that·must·correspond·to·a·row·in·another·table),·you·can·use·the·special
236 syntax·for·its·type:237 syntax·for·its·type:
237 fk_type·::=·'FK'·<table_name>·[·'('·<reverse_name>·')'·]238 fk_type·::=·'FK'·<table_name>·[·'('·<reverse_name>·')'·]
238 As·you·can·see,·the·type·of·the·field·is·not·specified·explicitly,·but·will·always·be·that·of·the·foreign·table's·primary239 As·you·can·see,·the·type·of·the·field·is·not·specified·explicitly,·but·will·always·be·that·of·the·foreign·tables·primary
239 key.·With·this·syntax,·the·foreign·table·must·have·a·single·field·for·its·primary·key.·GNATColl·does·not·force·a240 key.·With·this·syntax,·the·foreign·table·must·have·a·single·field·for·its·primary·key.·GNATColl·does·not·force·a
240 specific·order·for·the·declaration·of·tables:·if·is·valid·to·have·a·foreign·key·to·a·table·that·hasn't·been·declared·yet.241 specific·order·for·the·declaration·of·tables:·if·is·valid·to·have·a·foreign·key·to·a·table·that·hasnt·been·declared·yet.
241 There·is·however·a·restriction·if·you·use·the·model·to·create·a·sqlite·database·(through·the·-createdb·switch·of242 There·is·however·a·restriction·if·you·use·the·model·to·create·a·sqlite·database·(through·the·-createdb·switch·of
242 gnatcoll_db2ada):·in·this·case,·a·reference·to·a·table·that·hasn't·been·defined·yet·may·not·be·not·through·a·field243 gnatcoll_db2ada):·in·this·case,·a·reference·to·a·table·that·hasnt·been·defined·yet·may·not·be·not·through·a·field
243 marked·as·NOT·NULL.·This·is·a·limitation·of·the·sqlite·backend·itself.·The·solution·in·this·case·is·to·reorder·the244 marked·as·NOT·NULL.·This·is·a·limitation·of·the·sqlite·backend·itself.·The·solution·in·this·case·is·to·reorder·the
244 declaration·of·tables,·or·drop·the·NOT·NULL·constraint.245 declaration·of·tables,·or·drop·the·NOT·NULL·constraint.
245 Another·restriction·is·that·a·foreign·key·that·is·also·a·primary·key·must·reference·a·table·that·has·already·been246 Another·restriction·is·that·a·foreign·key·that·is·also·a·primary·key·must·reference·a·table·that·has·already·been
246 defined.·You·need·to·reorder·the·declaration·of·your·tables·to·ensure·this·is·the·case.247 defined.·You·need·to·reorder·the·declaration·of·your·tables·to·ensure·this·is·the·case.
247 "reverse_name"·is·the·optional·name·that·will·be·generated·in·the·Ada·code·for·the·reverse·relationship,·in·the248 reverse_name·is·the·optional·name·that·will·be·generated·in·the·Ada·code·for·the·reverse·relationship,·in·the
248 context·of·GNATCOLL.SQL.ORM.·If·the·"reverse_name"·is·empty·(the·parenthesis·are·shown),·no·reverse·relationship·is·generated.·If·the·parenthesis·and·the·reverse_name·are·both·omitted,·a·default·name·is·generated249 context·of·GNATCOLL.SQL.ORM.·If·the·reverse_name·is·empty·(the·parenthesis·are·shown),·no·reverse·relationship·is·generated.·If·the·parenthesis·and·the·reverse_name·are·both·omitted,·a·default·name·is·generated
249 based·on·the·name·of·the·field.250 based·on·the·name·of·the·field.
250 The·third·column·in·the·fields·definition·indicates·the·constraints·of·the·type.·Multiple·keywords·can·be·used·if251 The·third·column·in·the·fields·definition·indicates·the·constraints·of·the·type.·Multiple·keywords·can·be·used·if
251 they·are·separated·by·commas.·Thus,·"NOT·NULL,·INDEX"·indicates·a·column·that·must·be·set·by·the·user,252 they·are·separated·by·commas.·Thus,·NOT·NULL,·INDEX·indicates·a·column·that·must·be·set·by·the·user,
252 and·for·which·an·index·is·created·to·speed·up·look·ups.253 and·for·which·an·index·is·created·to·speed·up·look·ups.
253 ·A·primary·key·("PK")254 ·A·primary·key·(PK)
254 ·The·value·must·be·defined·("NOT·NULL")255 ·The·value·must·be·defined·(NOT·NULL)
Max diff block lines reached; 69023/83038 bytes (83.12%) of diff not shown.