Skip to content

Commit

Permalink
sanity formatting of SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed May 16, 2008
1 parent 32f513b commit 09083b6
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 38 deletions.
73 changes: 42 additions & 31 deletions symmetric/src/docbook/user-guide/ch05-basic-configuration.xml
Expand Up @@ -261,7 +261,7 @@
</variablelist>
</section>
<section>
<title>Node Groups</title>
<title>Node Group</title>
<para>
Each Node must belong to a Node Group, a collection of one or more Nodes.
A common use of Node Groups is to describe a level in a hierarchy of data synchronization.
Expand All @@ -273,15 +273,19 @@
The following SQL statements would create Node Groups for "corp" and "store".

<programlisting>
<![CDATA[insert into sym_node_group (node_group_id, description)
values ('store', 'A retail store node');
<![CDATA[insert into SYM_NODE_GROUP
(node_group_id, description)
values
('store', 'A retail store node');
insert into sym_node_group (node_group_id, description)
values ('corp', 'A corporate node');]]></programlisting>
insert into SYM_NODE_GROUP
(node_group_id, description)
values
('corp', 'A corporate node');]]></programlisting>
</para>
</section>
<section>
<title>Node Group Links</title>
<title>Node Group Link</title>
<para>
To establish synchronization between Nodes, two Node Groups are linked together. The direction
of synchronization is determined by specifying a source and target Node Group.
Expand All @@ -296,17 +300,19 @@ values ('corp', 'A corporate node');]]></programlisting>
and the "corp" Nodes to send changes to "store" Nodes by waiting for a pull.

<programlisting>
<![CDATA[insert into sym_node_group_link
(source_node_group, target_node_group, data_event_action)
values ('store', 'corp', 'P');
<![CDATA[insert into SYM_NODE_GROUP_LINK
(source_node_group, target_node_group, data_event_action)
values
('store', 'corp', 'P');
insert into sym_node_group_link
(source_node_group, target_node_group, data_event_action)
values ('corp', 'store', 'W');]]></programlisting>
insert into SYM_NODE_GROUP_LINK
(source_node_group, target_node_group, data_event_action)
values
('corp', 'store', 'W');]]></programlisting>
</para>
</section>
<section>
<title>Nodes</title>
<title>Node</title>
<para>
Each instance of SymmetricDS is a Node that can be uniquely identified.
The Node has a unique identifier used by the system, and the user provides an external identifier
Expand All @@ -320,14 +326,16 @@ values ('corp', 'store', 'W');]]></programlisting>
as "00000" in the "corp" Node Group.

<programlisting>
<![CDATA[insert into sym_node (node_id, node_group_id, external_id, sync_enabled, symmetric_version)
values ('00000', 'corp', '00000', 1, '1.3.0');
<![CDATA[insert into SYM_NODE
(node_id, node_group_id, external_id, sync_enabled, symmetric_version)
values
('00000', 'corp', '00000', 1, '1.3.0');
insert into sym_node_identity values ('00000');]]></programlisting>
insert into SYM_NODE_IDENTITY values ('00000');]]></programlisting>
</para>
</section>
<section>
<title>Channels</title>
<title>Channel</title>
<para>
Data changes in the database are captured in the order that they occur, which is preserved
when synchronizing to other Nodes. Some data may need priority for synchronization despite
Expand All @@ -342,17 +350,19 @@ insert into sym_node_identity values ('00000');]]></programlisting>
sales at a register.

<programlisting>
<![CDATA[insert into sym_channel
(channel_id, processing_order, max_batch_size, enabled, description)
values('item', 10, 100000, 1, 'Item and pricing data');
<![CDATA[insert into SYM_CHANNEL
(channel_id, processing_order, max_batch_size, enabled, description)
values
('item', 10, 100000, 1, 'Item and pricing data');
insert into sym_channel
(channel_id, processing_order, max_batch_size, enabled, description)
values('sale_transaction', 1, 100000, 1, 'retail sale transactions from register');]]></programlisting>
insert into SYM_CHANNEL
(channel_id, processing_order, max_batch_size, enabled, description)
values
('sale_transaction', 1, 100000, 1, 'retail sale transactions from register');]]></programlisting>
</para>
</section>
<section>
<title>Triggers</title>
<title>Trigger</title>
<para>
At the heart of SymmetricDS are Triggers that define what data to capture. Nodes in the source
Node Group will capture changes for a table and send them to a target Node Group.
Expand All @@ -366,13 +376,14 @@ values('sale_transaction', 1, 100000, 1, 'retail sale transactions from register
whenever data is inserted, updated, or deleted. Data will be captured on Nodes in the "corp"
Node Group and sent to Nodes in the "store" Node Group.
<programlisting>
<![CDATA[insert into sym_trigger
(source_table_name, source_node_group_id, target_node_group_id, channel_id,
sync_on_insert, sync_on_update, sync_on_delete,
initial_load_order, last_updated_by, last_updated_time, create_time)
values('item', 'corp', 'store', 'item',
1, 1, 1,
105, 'demo', current_timestamp, current_timestamp);
<![CDATA[insert into SYM_TRIGGER
(source_table_name, source_node_group_id, target_node_group_id, channel_id,
sync_on_insert, sync_on_update, sync_on_delete,
initial_load_order, last_updated_by, last_updated_time, create_time)
values
('item', 'corp', 'store', 'item',
1, 1, 1,
105, 'demo', current_timestamp, current_timestamp);
]]></programlisting>
</para>
</section>
Expand Down
15 changes: 8 additions & 7 deletions symmetric/src/docbook/user-guide/ch06-advanced-configuration.xml
Expand Up @@ -49,13 +49,14 @@
the sale_transaction table to the "store" Node Group from the "corp" Node Group during
an initial load.
<programlisting>
<![CDATA[insert into sym_trigger
(source_table_name, source_node_group_id, target_node_group_id, channel_id,
sync_on_insert, sync_on_update, sync_on_delete,
initial_load_order, last_updated_by, last_updated_time, create_time)
values('sale_transaction', 'corp', 'store', 'sale_transaction',
0, 0, 0,
105, 'demo', current_timestamp, current_timestamp);]]></programlisting>
<![CDATA[insert into SYM_TRIGGER
(source_table_name, source_node_group_id, target_node_group_id, channel_id,
sync_on_insert, sync_on_update, sync_on_delete,
initial_load_order, last_updated_by, last_updated_time, create_time)
values
('sale_transaction', 'corp', 'store', 'sale_transaction',
0, 0, 0,
105, 'demo', current_timestamp, current_timestamp);]]></programlisting>
</para>
</section>
<section>
Expand Down

0 comments on commit 09083b6

Please sign in to comment.