Skip to content

Commit

Permalink
Docs - Update SchemaSpy database documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mdouchin committed May 27, 2021
1 parent b07f86a commit f4942d0
Show file tree
Hide file tree
Showing 14 changed files with 1,584 additions and 451 deletions.
530 changes: 265 additions & 265 deletions docs/database/columns.html

Large diffs are not rendered by default.

393 changes: 273 additions & 120 deletions docs/database/gis.lizsync.xml

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/database/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h1>Tables</h1><br />
<div class="col-md-12">
<div class="callout callout-info">
<h4>SchemaSpy Analysis of gis</h4>
<p>Generated on Mon May 03 13:46 GMT 2021</p>
<p>Generated on Thu May 27 09:24 GMT 2021</p>
</div>
</div>
</div>
Expand Down Expand Up @@ -154,7 +154,7 @@ <h4>SchemaSpy Analysis of gis</h4>
<span class="info-box-icon bg-navy"><i class="fa fa-file-code-o" aria-hidden="true"></i></span>
<div class="info-box-content">
<span class="info-box-text">Routines</span>
<span class="info-box-number">18</span>
<span class="info-box-number">23</span>
</div>
<!-- /.info-box-content -->
</div>
Expand Down Expand Up @@ -209,31 +209,31 @@ <h3 class="box-title">Tables</h3>
<td class="comment detail" style="display: table-cell;"><p>Database structure metadata used for migration by QGIS plugin</p></td>
</tr>
<tr class="tbl even" valign="top">
<td class="detail"><a href="tables/logged_relations.html">logged_relations</a></td>
<td class="detail"><a href="tables/server_metadata.html">server_metadata</a></td>
<td class="detail" align="right">0</td>
<td class="detail" align="right">0</td>
<td class="detail" align="right">2</td>
<td class="detail" align="right">0</td>
<td class="detail" align="right">Table</td>
<td class="comment detail" style="display: table-cell;"><p>Table used to store unique identifier columns for table or views, so that events can be replayed</p></td>
<td class="comment detail" style="display: table-cell;"></td>
</tr>
<tr class="tbl even" valign="top">
<td class="detail"><a href="tables/server_metadata.html">server_metadata</a></td>
<td class="detail"><a href="tables/synchronized_tables.html">synchronized_tables</a></td>
<td class="detail" align="right">0</td>
<td class="detail" align="right">0</td>
<td class="detail" align="right">2</td>
<td class="detail" align="right">0</td>
<td class="detail" align="right">Table</td>
<td class="comment detail" style="display: table-cell;"></td>
<td class="comment detail" style="display: table-cell;"><p>List of tables to synchronise per clone server id. This list works as a white list. Only listed tables will be synchronised for each server ids.</p></td>
</tr>
<tr class="tbl even" valign="top">
<td class="detail"><a href="tables/synchronized_tables.html">synchronized_tables</a></td>
<td class="detail"><a href="tables/logged_relations.html">logged_relations</a></td>
<td class="detail" align="right">0</td>
<td class="detail" align="right">0</td>
<td class="detail" align="right">2</td>
<td class="detail" align="right">0</td>
<td class="detail" align="right">Table</td>
<td class="comment detail" style="display: table-cell;"><p>List of tables to synchronise per clone server id. This list works as a white list. Only listed tables will be synchronised for each server ids.</p></td>
<td class="comment detail" style="display: table-cell;"><p>Table used to store unique identifier columns for table or views, so that events can be replayed</p></td>
</tr>
<tr class="tbl even" valign="top">
<td class="detail"><a href="tables/logged_actions.html">logged_actions</a></td>
Expand Down
4 changes: 2 additions & 2 deletions docs/database/info-html.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
date=2021-05-03 13:46:21+0000
os=Linux 5.8.0-50-generic
date=2021-05-27 09:25:00+0000
os=Linux 5.8.0-53-generic
schemaspy-version=6.1.0
schemaspy-build=6.1.0.41 2019-09-17 21:52:57
diagramImplementation=Graphviz dot 2.38
61 changes: 48 additions & 13 deletions docs/database/routines.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ <h3 class="box-title">Routines</h3>
</tr>
</thead>
<tbody>
<tr>
<td><a href="routines/insert_history_item.html">insert_history_item</a></td>
<td>FUNCTION</td>
<td>PLPGSQL</td>
<td>false</td>
<td>uuid</td>
<td>DEFINER</td>
<td><p>Add a new history item in the lizsync.history table as the owner of the table. The SECURITY DEFINER allows the clone to update the protected table. DO NOT USE MANUALLY.</p></td>
</tr>
<tr>
<td><a href="routines/rollback_event.html">rollback_event</a></td>
<td>FUNCTION</td>
Expand Down Expand Up @@ -128,16 +137,11 @@ <h3 class="box-title">Routines</h3>
<tr>
<td><a href="routines/audit_view.html">audit_view</a></td>
<td>FUNCTION</td>
<td>PLPGSQL</td>
<td>SQL</td>
<td>false</td>
<td>void</td>
<td>INVOKER</td>
<td><p>ADD auditing support TO a VIEW.</p>
<p>Arguments:<br />
target_view: TABLE name, schema qualified IF NOT ON search_path<br />
audit_query_text: Record the text of the client query that triggered the audit event?<br />
ignored_cols: COLUMNS TO exclude FROM UPDATE diffs, IGNORE updates that CHANGE only ignored cols.<br />
uid_cols: COLUMNS to use to uniquely identify a row from the view (in order to replay UPDATE and DELETE)</p></td>
<td></td>
</tr>
<tr>
<td><a href="routines/analyse_audit_logs.html">analyse_audit_logs</a></td>
Expand Down Expand Up @@ -211,6 +215,15 @@ <h3 class="box-title">Routines</h3>
pevent_id: The event_id of the event in lizsync.logged_actions to replay<br />
puid_column: The name of the column with unique uuid values</p></td>
</tr>
<tr>
<td><a href="routines/update_synchronized_table.html">update_synchronized_table</a></td>
<td>FUNCTION</td>
<td>PLPGSQL</td>
<td>false</td>
<td>boolean</td>
<td>DEFINER</td>
<td><p>Insert or Update the table lizsync.synchronized_tables. The SECURITY DEFINER allows the clone to update the protected table. DO NOT USE MANUALLY.</p></td>
</tr>
<tr>
<td><a href="routines/create_central_server_fdw.html">create_central_server_fdw</a></td>
<td>FUNCTION</td>
Expand Down Expand Up @@ -247,6 +260,15 @@ <h3 class="box-title">Routines</h3>
<td>INVOKER</td>
<td><p>Replay all logs from the clone to the central database. It returns the number of actions replayed. After this, the clone audit logs are truncated.</p></td>
</tr>
<tr>
<td><a href="routines/update_history_item.html">update_history_item</a></td>
<td>FUNCTION</td>
<td>PLPGSQL</td>
<td>false</td>
<td>boolean</td>
<td>DEFINER</td>
<td><p>Update the status of a history item in the lizsync.history table as the owner of the table. The SECURITY DEFINER allows the clone to update the protected table. DO NOT USE MANUALLY.</p></td>
</tr>
<tr>
<td><a href="routines/replay_event.html">replay_event</a></td>
<td>FUNCTION</td>
Expand Down Expand Up @@ -274,12 +296,7 @@ <h3 class="box-title">Routines</h3>
<td>false</td>
<td>void</td>
<td>INVOKER</td>
<td><p>Add auditing support to a table.</p>
<p>Arguments:<br />
target_table: Table name, schema qualified if not on search_path<br />
audit_rows: Record each row change, or only audit at a statement level<br />
audit_query_text: Record the text of the client query that triggered the audit event?<br />
ignored_cols: Columns to exclude from update diffs, ignore updates that change only ignored cols.</p></td>
<td></td>
</tr>
<tr>
<td><a href="routines/replay_central_logs_to_clone.html">replay_central_logs_to_clone</a></td>
Expand All @@ -290,6 +307,15 @@ <h3 class="box-title">Routines</h3>
<td>INVOKER</td>
<td><p>Replay the central logs in the clone database, then modifiy the corresponding audit logs in the central server to update the sync_data column. A new item is also created in the central server lizsync.history table. When running the log queries, we disable triggers in the clone to avoid adding more rows to the local audit logged_actions table</p></td>
</tr>
<tr>
<td><a href="routines/update_central_logs_add_clone_action_timestamps.html">update_central_logs_add_clone_action_timestamps</a></td>
<td>FUNCTION</td>
<td>PLPGSQL</td>
<td>false</td>
<td>boolean</td>
<td>DEFINER</td>
<td><p>Update all logs created by the central database after the clone has replayed its local logs in the central database. It is necessary to update the action_tstamp_tx key of lizsync.logged_actions sync_data column. The SECURITY DEFINER allows the clone to update the protected lizsync.logged_actions table. DO NOT USE MANUALLY.</p></td>
</tr>
<tr>
<td><a href="routines/import_central_server_schemas.html">import_central_server_schemas</a></td>
<td>FUNCTION</td>
Expand All @@ -299,6 +325,15 @@ <h3 class="box-title">Routines</h3>
<td>INVOKER</td>
<td><p>Import synchronised schemas from the central database foreign server into central_XXX local schemas to the clone database. This allow to edit data of the central database from the clone.</p></td>
</tr>
<tr>
<td><a href="routines/update_central_logs_add_clone_id.html">update_central_logs_add_clone_id</a></td>
<td>FUNCTION</td>
<td>PLPGSQL</td>
<td>false</td>
<td>boolean</td>
<td>DEFINER</td>
<td><p>Update the central database synchronisation logs (table lizsync.logged_actions) by adding the clone ID in the &ldquo;replayed_by&rdquo; property of the field &ldquo;sync_data&rdquo;. The SECURITY DEFINER allows the clone to update the protected lizsync.logged_actions table. DO NOT USE MANUALLY.</p></td>
</tr>
</tbody>
</table>
</div>
Expand Down
20 changes: 0 additions & 20 deletions docs/database/routines/audit_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,6 @@
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>audit_table</h1><br />
<div class="box box-primary">
<div class="box-header with-border">
<i class="fa fa-file-text-o"></i>
<h3 id="Description" class="box-title">Description</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
</div>
<!-- /.box-header -->
<div class="box-body clearfix">
<p><p>Add auditing support to a table.</p>
<p>Arguments:<br />
target_table: Table name, schema qualified if not on search_path<br />
audit_rows: Record each row change, or only audit at a statement level<br />
audit_query_text: Record the text of the client query that triggered the audit event?<br />
ignored_cols: Columns to exclude from update diffs, ignore updates that change only ignored cols.</p></p>
</div>
<!-- /.box-body -->
</div>
</section>
<!-- Main content -->
<section class="content">
Expand Down
22 changes: 1 addition & 21 deletions docs/database/routines/audit_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,6 @@
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>audit_view</h1><br />
<div class="box box-primary">
<div class="box-header with-border">
<i class="fa fa-file-text-o"></i>
<h3 id="Description" class="box-title">Description</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
</div>
<!-- /.box-header -->
<div class="box-body clearfix">
<p><p>ADD auditing support TO a VIEW.</p>
<p>Arguments:<br />
target_view: TABLE name, schema qualified IF NOT ON search_path<br />
audit_query_text: Record the text of the client query that triggered the audit event?<br />
ignored_cols: COLUMNS TO exclude FROM UPDATE diffs, IGNORE updates that CHANGE only ignored cols.<br />
uid_cols: COLUMNS to use to uniquely identify a row from the view (in order to replay UPDATE and DELETE)</p></p>
</div>
<!-- /.box-body -->
</div>
</section>
<!-- Main content -->
<section class="content">
Expand Down Expand Up @@ -175,7 +155,7 @@ <h3 id="RoutineDefinition" class="box-title">Definition</h3>
</div>
</div>
<div class="box-body">
<textarea id="sql-script-codemirror" name="sql-script-codemirror" rows="" style="display: none;">&#10;DECLARE&#10; stm_targets text = &#39;INSERT OR UPDATE OR DELETE&#39;;&#10; _q_txt text;&#10; _ignored_cols_snip text = &#39;&#39;;&#10;&#10;BEGIN&#10; EXECUTE &#39;DROP TRIGGER IF EXISTS lizsync_audit_trigger_row ON &#39; || target_view::text;&#10; EXECUTE &#39;DROP TRIGGER IF EXISTS lizsync_audit_trigger_stm ON &#39; || target_view::text;&#10;&#10; IF array_length(ignored_cols,1) &gt; 0 THEN&#10; _ignored_cols_snip = &#39;, &#39; || quote_literal(ignored_cols);&#10; END IF;&#10; _q_txt = &#39;CREATE TRIGGER lizsync_audit_trigger_row INSTEAD OF INSERT OR UPDATE OR DELETE ON &#39; ||&#10; target_view::TEXT ||&#10; &#39; FOR EACH ROW EXECUTE PROCEDURE lizsync.if_modified_func(&#39; ||&#10; quote_literal(audit_query_text) || _ignored_cols_snip || &#39;);&#39;;&#10; RAISE NOTICE &#39;%&#39;,_q_txt;&#10; EXECUTE _q_txt;&#10;&#10; -- store uid columns if not already present&#10; IF (select count(*) from lizsync.logged_relations where relation_name = (select target_view)::text AND uid_column= (select unnest(uid_cols))::text) = 0 THEN&#10; insert into lizsync.logged_relations (relation_name, uid_column)&#10; select target_view, unnest(uid_cols);&#10; END IF;&#10;&#10;END;&#10;</textarea>
<textarea id="sql-script-codemirror" name="sql-script-codemirror" rows="" style="display: none;">&#10;SELECT lizsync.audit_view($1, BOOLEAN &#39;t&#39;, uid_cols);&#10;</textarea>
</div>
</div>
</section>
Expand Down
Loading

0 comments on commit f4942d0

Please sign in to comment.