117 KB
/srv/reproducible-results/rbuild-debian/r-b-build.kaGYlbuK/b1/libgnatcoll-db_23.0.0-6_amd64.changes vs.
/srv/reproducible-results/rbuild-debian/r-b-build.kaGYlbuK/b2/libgnatcoll-db_23.0.0-6_amd64.changes
1.08 KB
Files
    
Offset 1, 11 lines modifiedOffset 1, 11 lines modified
  
1 ·da493d4053cc50fada29480cb48d919b·397328·debug·optional·libgnatcoll-db-bin-dbgsym_23.0.0-6_amd64.deb1 ·da493d4053cc50fada29480cb48d919b·397328·debug·optional·libgnatcoll-db-bin-dbgsym_23.0.0-6_amd64.deb
2 ·5f89c3d38ce3bfbece4c12f6aa9042b4·217512·devel·optional·libgnatcoll-db-bin_23.0.0-6_amd64.deb2 ·5f89c3d38ce3bfbece4c12f6aa9042b4·217512·devel·optional·libgnatcoll-db-bin_23.0.0-6_amd64.deb
3 ·dede6ba24626fdcef6850ccdee8f23fd·494212·doc·optional·libgnatcoll-db-doc_23.0.0-6_all.deb3 ·69c40ce5801c43b928df0c53309b87e1·241908·doc·optional·libgnatcoll-db-doc_23.0.0-6_all.deb
4 ·a07d6dfd62d38fa3d50abbcb37fd13f7·166432·libdevel·optional·libgnatcoll-postgres-dev_23.0.0-6_amd64.deb4 ·a07d6dfd62d38fa3d50abbcb37fd13f7·166432·libdevel·optional·libgnatcoll-postgres-dev_23.0.0-6_amd64.deb
5 ·888c2c1bddb710666d1db7da2068d80f·231652·debug·optional·libgnatcoll-postgres2-dbgsym_23.0.0-6_amd64.deb5 ·888c2c1bddb710666d1db7da2068d80f·231652·debug·optional·libgnatcoll-postgres2-dbgsym_23.0.0-6_amd64.deb
6 ·44de4eb2b603dfafbf8ab634bb7e8143·148612·libs·optional·libgnatcoll-postgres2_23.0.0-6_amd64.deb6 ·44de4eb2b603dfafbf8ab634bb7e8143·148612·libs·optional·libgnatcoll-postgres2_23.0.0-6_amd64.deb
7 ·943cba641ace2c35b02456a5a5010dae·1258548·libdevel·optional·libgnatcoll-sql-dev_23.0.0-6_amd64.deb7 ·943cba641ace2c35b02456a5a5010dae·1258548·libdevel·optional·libgnatcoll-sql-dev_23.0.0-6_amd64.deb
8 ·56841426f7597a1d332e0def015937d1·2047900·debug·optional·libgnatcoll-sql4-dbgsym_23.0.0-6_amd64.deb8 ·56841426f7597a1d332e0def015937d1·2047900·debug·optional·libgnatcoll-sql4-dbgsym_23.0.0-6_amd64.deb
9 ·108e1c8deaab2eb806fa17ec99c3df73·1107632·libs·optional·libgnatcoll-sql4_23.0.0-6_amd64.deb9 ·108e1c8deaab2eb806fa17ec99c3df73·1107632·libs·optional·libgnatcoll-sql4_23.0.0-6_amd64.deb
10 ·d466e9ff410789171d7c187f999a9e84·73856·libdevel·optional·libgnatcoll-sqlite-dev_23.0.0-6_amd64.deb10 ·d466e9ff410789171d7c187f999a9e84·73856·libdevel·optional·libgnatcoll-sqlite-dev_23.0.0-6_amd64.deb
116 KB
libgnatcoll-db-doc_23.0.0-6_all.deb
452 B
file list
    
Offset 1, 3 lines modifiedOffset 1, 3 lines modified
1 -rw-r--r--···0········0········0········4·2024-03-17·17:46:00.000000·debian-binary1 -rw-r--r--···0········0········0········4·2024-03-17·17:46:00.000000·debian-binary
2 -rw-r--r--···0········0········0·····1716·2024-03-17·17:46:00.000000·control.tar.xz2 -rw-r--r--···0········0········0·····1712·2024-03-17·17:46:00.000000·control.tar.xz
3 -rw-r--r--···0········0········0···492304·2024-03-17·17:46:00.000000·data.tar.xz3 -rw-r--r--···0········0········0···240004·2024-03-17·17:46:00.000000·data.tar.xz
575 B
control.tar.xz
547 B
control.tar
477 B
./control
    
Offset 1, 13 lines modifiedOffset 1, 13 lines modified
1 Package:·libgnatcoll-db-doc1 Package:·libgnatcoll-db-doc
2 Source:·libgnatcoll-db2 Source:·libgnatcoll-db
3 Version:·23.0.0-63 Version:·23.0.0-6
4 Architecture:·all4 Architecture:·all
5 Maintainer:·Nicolas·Boulenguez·<nicolas@debian.org>5 Maintainer:·Nicolas·Boulenguez·<nicolas@debian.org>
6 Installed-Size:·9496 Installed-Size:·703
7 Depends:·libjs-jquery·(>=·3.6.0),·libjs-sphinxdoc·(>=·8.1),·sphinx-rtd-theme-common·(>=·3.0.2+dfsg)7 Depends:·libjs-jquery·(>=·3.6.0),·libjs-sphinxdoc·(>=·8.1),·sphinx-rtd-theme-common·(>=·3.0.2+dfsg)
8 Suggests:·gnat8 Suggests:·gnat
9 Built-Using:·sphinx·(=·8.1.3-4)9 Built-Using:·sphinx·(=·8.1.3-4)
10 Section:·doc10 Section:·doc
11 Priority:·optional11 Priority:·optional
12 Multi-Arch:·foreign12 Multi-Arch:·foreign
13 Homepage:·https://github.com/AdaCore/gnatcoll-db13 Homepage:·https://github.com/AdaCore/gnatcoll-db
48.0 B
./md5sums
30.0 B
./md5sums
Files differ
115 KB
data.tar.xz
115 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·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/dbschema.txt11 -rw-r--r--···0·root·········(0)·root·········(0)·····1321·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/dbschema.txt
12 -rw-r--r--···0·root·········(0)·root·········(0)······463·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/default.gpr12 -rw-r--r--···0·root·········(0)·root·········(0)······463·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/default.gpr
13 -rw-r--r--···0·root·········(0)·root·········(0)······812·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/fixture.txt13 -rw-r--r--···0·root·········(0)·root·········(0)······812·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/fixture.txt
14 -rwxr-xr-x···0·root·········(0)·root·········(0)······124·2024-03-17·17:46:00.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/generate.sh14 -rwxr-xr-x···0·root·········(0)·root·········(0)······124·2024-03-17·17:46:00.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/generate.sh
15 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-17·17:46:00.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/generated/15 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-17·17:46:00.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/generated/
16 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/src/16 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/src/
17 -rw-r--r--···0·root·········(0)·root·········(0)·····7115·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/src/library.adb17 -rw-r--r--···0·root·········(0)·root·········(0)·····7115·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/examples/library/src/library.adb
18 -rw-r--r--···0·root·········(0)·root·········(0)···344161·2024-03-17·17:46:00.000000·./usr/share/doc/libgnatcoll-db-doc/gnatcoll-db.pdf.gz18 -rw-r--r--···0·root·········(0)·root·········(0)····92221·2024-03-17·17:46:00.000000·./usr/share/doc/libgnatcoll-db-doc/gnatcoll-db.pdf.gz
19 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-17·17:46:00.000000·./usr/share/doc/libgnatcoll-db-doc/html/19 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-17·17:46:00.000000·./usr/share/doc/libgnatcoll-db-doc/html/
20 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-17·17:46:00.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/20 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-17·17:46:00.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/
21 -rw-r--r--···0·root·········(0)·root·········(0)·····1447·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/important.png21 -rw-r--r--···0·root·········(0)·root·········(0)·····1447·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/important.png
22 -rw-r--r--···0·root·········(0)·root·········(0)·····2247·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/note.png22 -rw-r--r--···0·root·········(0)·root·········(0)·····2247·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/note.png
23 -rw-r--r--···0·root·········(0)·root·········(0)·····2143·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/tip.png23 -rw-r--r--···0·root·········(0)·root·········(0)·····2143·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/html/_images/tip.png
24 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-17·17:46:00.000000·./usr/share/doc/libgnatcoll-db-doc/html/_sources/24 drwxr-xr-x···0·root·········(0)·root·········(0)········0·2024-03-17·17:46:00.000000·./usr/share/doc/libgnatcoll-db-doc/html/_sources/
25 -rw-r--r--···0·root·········(0)·root·········(0)······413·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/html/_sources/index.rst.txt25 -rw-r--r--···0·root·········(0)·root·········(0)······413·2022-09-22·17:07:33.000000·./usr/share/doc/libgnatcoll-db-doc/html/_sources/index.rst.txt
112 KB
./usr/share/doc/libgnatcoll-db-doc/gnatcoll-db.pdf.gz
112 KB
gnatcoll-db.pdf
112 KB
pdftotext {} -
    
Offset 6, 2029 lines modifiedOffset 6, 28 lines modified
  
6 Mar·17,·20246 Mar·17,·2024
  
7 \xc\xcCONTENTS7 \xc\xcCONTENTS
  
8 18 1
  
9 SQL:·Database·interface 
10 1.1·Database·Abstraction·Layers·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
11 1.2·Database·example·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
12 1.3·Database·schema·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
13 1.4·The·gnatcoll_db2ada·tool·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
14 1.4.1 
15 Default·output·of·gnatcoll_db2ada·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
16 1.4.2 
17 database·introspection·in·Ada·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
18 1.4.3 
19 Back·to·the·library·example.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
20 1.5·Connecting·to·the·database·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
21 1.6·Loading·initial·data·in·the·database·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
22 1.7·Writing·queries·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
23 1.8·Executing·queries·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
24 1.9·Prepared·queries·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
25 1.10·Getting·results·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
26 1.11·Creating·your·own·SQL·types·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
27 1.12·Query·logs·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
28 1.13·Writing·your·own·cursors·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
29 1.14·The·Object-Relational·Mapping·layer·(ORM)·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
30 1.14.1·reverse·relationships·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
31 1.15·Modifying·objects·in·the·ORM·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
32 1.16·Object·factories·in·ORM·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·.·. 
  
33 1 
34 2 
35 3 
36 3 
37 6 
38 9 
39 9 
40 9 
41 10 
42 12 
43 14 
44 16 
45 17 
46 19 
47 20 
48 21 
49 22 
50 23 
51 27 
52 28 
53 29 
  
54 2 
  
55 Xref:·Cross-referencing·source·code 
  
56 33 
  
57 3 
  
58 Xref:·gnatinspect 
  
59 37 
  
60 4 
  
61 Indices·and·tables9 Indices·and·tables
  
 10 1
62 41 
  
63 Index 
  
64 43 
  
65 i11 i
  
66 \xcii12 \xcii
  
67 \xcCHAPTER13 \xcCHAPTER
  
68 ONE14 ONE
  
69 SQL:·DATABASE·INTERFACE 
  
70 A·lot·of·applications·need·to·provide·persistence·for·their·data·(or·a·part·of·it).·This·means·the·data·needs·to·be·somehow 
71 saved·on·the·disk,·to·be·read·and·manipulated·later,·possibly·after·the·application·has·been·terminated·and·restarted. 
72 Although·Ada·provides·various·solutions·for·this·(including·the·use·of·the·streams·as·declared·in·the·Ada·Reference 
73 Manual),·the·common·technique·is·through·the·use·of·relational·database·management·systems·(RDBMS.·The·term 
74 database·is·in·fact·overloaded·in·this·context,·and·has·come·to·mean·different·things: 
75 ·The·software·system·that·implements·file·and·query·management.·This·is·generally·provided·by·a·third-party. 
76 The·common·abbreviation·for·these·is·DBMS.·Queries·are·generally·written·in·a·language·called·SQL.·One·of 
77 the·issues·is·that·each·DBMS·tends·to·make·minor·changes·to·this·language.·Another·issue·is·that·the·way·to·send 
78 these·SQL·commands·to·the·DBMS·is·vendor-specific.·GNATColl·tries·to·abstract·this·communication·through 
79 its·own·API.·It·currently·supports·PostgreSQL·and·sqlite,·and·makes·it·relatively·easy·to·change·between·these 
80 two·systems.·For·instance,·development·could·be·done·using·a·local·sqlite·DBMS,·and·then·deployed·(after 
81 testing,·of·course!)·on·a·PostgreSQL·system. 
82 The·code·in·GNATColl·is·such·that·adding·support·for·a·new·DBMS·should·be·relatively·easy. 
83 ·A·place·where·an·application·stores·its·data.·The·term·database·in·this·document·refers·to·this·meaning.·In·a 
84 relational·database,·this·place·is·organized·into·tables,·each·of·which·contains·a·number·of·fields.·A·row·in·a 
85 table·represents·one·object.·The·set·of·tables·and·their·fields·is·called·the·schema·of·the·database. 
86 Traditionally,·writing·the·SQL·queries·is·done·inline:·special·markers·are·inserted·into·your·code·to·delimit·sections 
87 that·contain·SQL·code·(as·opposed·to·Ada·code),·and·these·are·then·preprocessed·to·generate·actual·code.·This·isn’t 
88 the·approach·chosen·in·GNATColl:·there·are·several·drawbacks,·in·particular·your·code·is·no·longer·Ada·and·various 
89 tools·will·choke·on·it. 
90 The·other·usual·approach·is·to·write·the·queries·as·strings,·which·are·passed,·via·a·DBMS-specific·API,·to·the·DBMS 
91 server.·This·approach·is·very·fragile: 
92 ·The·string·might·not·contain·well-formed·SQL.·This·will·unfortunately·only·be·detected·at·run·time·when·the 
93 DBMS·complains. 
94 ·This·is·not·type·safe.·You·might·be·comparing·a·text·field·with·an·integer,·for·instance.·In·some·cases,·the·DBMS 
95 will·accept·that·(sqlite·for·instance),·but·in·some·other·cases·it·won’t·(PostgreSQL).·The·result·might·then·either 
96 raise·an·error,·or·return·an·empty·list. 
97 ·There·is·a·risk·of·SQL·injection.·Assuming·the·string·is·constructed·dynamically·(using·Ada’s·&·operator),·it 
98 might·be·easy·for·a·user·to·pass·a·string·that·breaks·the·query,·and·even·destroys·things·in·the·database. 
99 ·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. 
100 ·The·string·is·fragile·if·the·database·schema·changes.·Finding·whether·a·schema·change·impacts·any·of·the 
101 queries·requires·looking·at·all·the·strings·in·your·application. 
102 ·performance·might·be·an·issue.·Whenever·you·execute·a·query,·the·DBMS·will·analyze·it,·decide·how·to·execute 
103 it·(for·instance,·whether·it·should·traverse·all·the·rows·of·a·table,·or·whether·it·can·do·a·faster·lookup),·and·then 
  
104 1 
  
105 \xcGNATCOLL·Documentation·-·Database·packages,·Release·0.0 
  
106 retrieve·the·results.·The·analysis·pass·is·typically·slow·(relatively·the·overall·execution·time),·and·queries·can·in 
Max diff block lines reached; 449/114992 bytes (0.39%) of diff not shown.