Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added demos, unified template args, fixed many bugs
1. Added two demos that show a lot of server-side usage techniques. 2. Unified work with template arguments in server- and client-side modes. It makes templates more portable. 3. Fixed a lot of typos in installers. Added uninstaller for the demo. 4. Update README
- Loading branch information
Victor Osolovskiy
committed
Mar 2, 2015
1 parent
9c8210d
commit 4598e25
Showing
44 changed files
with
1,889 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
.idea | ||
target | ||
**/.svn | ||
src/demo/** | ||
src/demo/plsql/_temp/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- | ||
-- Copyright 2014-2015 Victor Osolovskiy, Sergey Navrotskiy | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
-- | ||
|
||
@types.sql | ||
|
||
@tabs.sql | ||
|
||
@demo_whs_goods.sql | ||
|
||
@demo_whs_goods_src.sql | ||
@demo_other_sources.sql | ||
|
||
@demo_dtoch_gen.pck | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
==== | ||
Copyright 2014-2015 Victor Osolovskiy, Sergey Navrotskiy | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
==== | ||
|
||
Demonstration of solving a real applied problem: detection of changes in a | ||
remote source. | ||
|
||
1. On the demo schema run `!install.sql`. It will install the base objects, | ||
which are needed to simulate a real system, and the generator package. | ||
|
||
2. Explore the `demo_dtoch_gen` package. | ||
|
||
3. Use `generate.sql` to generate utility objects for detection of changes in | ||
three source tables. | ||
|
||
4. Explore the result of generation and compare the new objects with their | ||
templates. | ||
|
||
5. Run `populate_data.sql` to fill two source tables with data. | ||
|
||
6. Run the tests from `test_scr.sql` to see how the solution works. | ||
|
||
7. Run `clean_result_of_generation.sql` to remove the generated objects and | ||
return to point 2. | ||
|
||
8. Run `!uninstall.sql` to remove all the directly installed objects (not | ||
generated) of and return to point 1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
-- | ||
-- Copyright 2014-2015 Victor Osolovskiy, Sergey Navrotskiy | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
-- | ||
|
||
declare | ||
l_scr ftldb_script_ot := ftldb_script_ot(); | ||
begin | ||
|
||
for r in ( | ||
select 'drop ' || lower(lst.tp) || ' ' || lower(lst.nm) cmd | ||
from user_objects o | ||
join( | ||
select 1 ord, 'PACKAGE' tp, 'DEMO_DTOCH_GEN' nm from dual union all | ||
select 2 ord, 'VIEW' tp, 'DEMO_WHS_GOODS_SRC' nm from dual union all | ||
select 3 ord, 'VIEW' tp, 'DEMO_OTHER1_SRC' nm from dual union all | ||
select 4 ord, 'VIEW' tp, 'DEMO_OTHER2_SRC' nm from dual union all | ||
select 5 ord, 'VIEW' tp, 'DEMO_WHS_GOODS' nm from dual union all | ||
select 6 ord, 'TYPE' tp, 'DEMO_DTOCH_GEN_PR_NT' nm from dual union all | ||
select 7 ord, 'TYPE' tp, 'DEMO_DTOCH_GEN_PR_OT' nm from dual union all | ||
select 8 ord, 'TABLE' tp, 'DEMO_GOODS_IN_WHS' nm from dual union all | ||
select 9 ord, 'TABLE' tp, 'DEMO_WAREHOUSES' nm from dual union all | ||
select 10 ord, 'TABLE' tp, 'DEMO_GOODS' nm from dual union all | ||
select 11 ord, 'SEQUENCE' tp, 'DEMO_CHANGE_SEQ' nm from dual union all | ||
select 99 ord, '' tp, '' nm from dual where 1=2 | ||
) lst | ||
on o.object_type = lst.tp and o.object_name = lst.nm | ||
order by lst.ord | ||
) loop | ||
l_scr.append(r.cmd); | ||
end loop; | ||
|
||
l_scr.exec(true); | ||
|
||
end; | ||
/ |
38 changes: 38 additions & 0 deletions
38
src/demo/plsql/detection_of_changes/clean_result_of_generation.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
-- | ||
-- Copyright 2014-2015 Victor Osolovskiy, Sergey Navrotskiy | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
-- | ||
|
||
declare | ||
l_scr ftldb_script_ot := ftldb_script_ot(); | ||
begin | ||
|
||
for r in ( | ||
select 'drop ' || lower(table_type) || ' ' || lower(table_name) cmd | ||
from user_tab_comments tc | ||
where tc.comments like '%@generated%' | ||
union all | ||
select 'drop package ' || lower(o.object_name) cmd | ||
from user_objects o | ||
where | ||
o.object_name = 'DEMO_DTOCH' and | ||
o.object_type = 'PACKAGE' | ||
) loop | ||
l_scr.append(r.cmd); | ||
end loop; | ||
|
||
l_scr.exec(true); | ||
|
||
end; | ||
/ |
Oops, something went wrong.