alf 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +89 -0
- data/Gemfile.lock +6 -1
- data/README.md +35 -21
- data/TODO.md +0 -5
- data/alf.gemspec +2 -0
- data/alf.noespec +6 -4
- data/bin/alf +9 -13
- data/examples/{autonum.alf → operators/autonum.alf} +0 -0
- data/examples/{cities.rash → operators/cities.rash} +0 -0
- data/examples/{clip.alf → operators/clip.alf} +0 -0
- data/examples/{compact.alf → operators/compact.alf} +0 -0
- data/examples/{database.alf → operators/database.alf} +1 -1
- data/examples/{defaults.alf → operators/defaults.alf} +0 -0
- data/examples/{extend.alf → operators/extend.alf} +0 -0
- data/examples/{group.alf → operators/group.alf} +0 -0
- data/examples/{intersect.alf → operators/intersect.alf} +0 -0
- data/examples/{join.alf → operators/join.alf} +0 -0
- data/examples/operators/matching.alf +2 -0
- data/examples/{minus.alf → operators/minus.alf} +0 -0
- data/examples/operators/not_matching.alf +2 -0
- data/examples/{nulls.rash → operators/nulls.rash} +0 -0
- data/examples/{parts.rash → operators/parts.rash} +0 -0
- data/examples/{project.alf → operators/project.alf} +0 -0
- data/examples/{pseudo-with.alf → operators/pseudo-with.alf} +0 -0
- data/examples/{quota.alf → operators/quota.alf} +0 -0
- data/examples/operators/rank.alf +4 -0
- data/examples/{rename.alf → operators/rename.alf} +0 -0
- data/examples/{restrict.alf → operators/restrict.alf} +0 -0
- data/examples/{schema.yaml → operators/schema.yaml} +0 -0
- data/examples/{sort.alf → operators/sort.alf} +0 -0
- data/examples/{summarize.alf → operators/summarize.alf} +0 -0
- data/examples/{suppliers.rash → operators/suppliers.rash} +0 -0
- data/examples/{supplies.rash → operators/supplies.rash} +0 -0
- data/examples/{ungroup.alf → operators/ungroup.alf} +0 -0
- data/examples/{union.alf → operators/union.alf} +0 -0
- data/examples/{unwrap.alf → operators/unwrap.alf} +0 -0
- data/examples/{wrap.alf → operators/wrap.alf} +0 -0
- data/lib/alf.rb +837 -62
- data/lib/alf/loader.rb +2 -1
- data/lib/alf/text.rb +160 -0
- data/lib/alf/version.rb +1 -1
- data/lib/alf/yaml.rb +24 -0
- data/spec/integration/__database__/group.alf +3 -0
- data/spec/integration/__database__/parts.rash +6 -0
- data/spec/integration/__database__/suppliers.rash +5 -0
- data/spec/integration/__database__/supplies.rash +12 -0
- data/spec/integration/command/alf/alf_e.cmd +1 -0
- data/spec/integration/command/alf/alf_e.stdout +4 -0
- data/spec/integration/command/alf/alf_env.cmd +1 -0
- data/spec/integration/command/alf/alf_env.stdout +5 -0
- data/spec/integration/command/alf/alf_implicit.alf +1 -0
- data/spec/integration/command/alf/alf_implicit_exec.cmd +1 -0
- data/spec/integration/command/alf/alf_implicit_exec.stdout +4 -0
- data/spec/integration/command/alf/alf_r.cmd +1 -0
- data/spec/integration/command/alf/alf_r.stdout +5 -0
- data/spec/integration/command/alf/alf_version.cmd +1 -0
- data/spec/integration/command/alf/alf_version.stdout +2 -0
- data/spec/integration/command/alf/alf_yaml.cmd +1 -0
- data/spec/integration/command/alf/alf_yaml.stdout +22 -0
- data/spec/integration/command/alf/rel.rash +1 -0
- data/spec/integration/command/autonum/autonum_0.cmd +1 -0
- data/spec/integration/command/autonum/autonum_0.stdout +9 -0
- data/spec/integration/command/autonum/autonum_1.cmd +1 -0
- data/spec/integration/command/autonum/autonum_1.stdout +9 -0
- data/spec/integration/command/clip/clip_0.cmd +1 -0
- data/spec/integration/command/clip/clip_0.stdout +9 -0
- data/spec/integration/command/clip/clip_1.cmd +1 -0
- data/spec/integration/command/clip/clip_1.stdout +9 -0
- data/spec/integration/command/compact/compact_0.cmd +1 -0
- data/spec/integration/command/compact/compact_0.stdout +9 -0
- data/spec/integration/command/defaults/defaults_0.cmd +1 -0
- data/spec/integration/command/defaults/defaults_0.stdout +9 -0
- data/spec/integration/command/defaults/defaults_1.cmd +1 -0
- data/spec/integration/command/defaults/defaults_1.stdout +9 -0
- data/spec/integration/command/extend/extend_0.cmd +1 -0
- data/spec/integration/command/extend/extend_0.stdout +16 -0
- data/spec/integration/command/group/group_0.cmd +1 -0
- data/spec/integration/command/group/group_0.stdout +32 -0
- data/spec/integration/command/group/group_1.cmd +1 -0
- data/spec/integration/command/group/group_1.stdout +32 -0
- data/spec/integration/command/intersect/intersect_0.cmd +1 -0
- data/spec/integration/command/intersect/intersect_0.stdout +9 -0
- data/spec/integration/command/join/join_0.cmd +1 -0
- data/spec/integration/command/join/join_0.stdout +16 -0
- data/spec/integration/command/matching/matching_0.cmd +1 -0
- data/spec/integration/command/matching/matching_0.stdout +8 -0
- data/spec/integration/command/minus/minus_0.cmd +1 -0
- data/spec/integration/command/minus/minus_0.stdout +4 -0
- data/spec/integration/command/not-matching/not-matching_0.cmd +1 -0
- data/spec/integration/command/not-matching/not-matching_0.stdout +5 -0
- data/spec/integration/command/project/project_0.cmd +1 -0
- data/spec/integration/command/project/project_0.stdout +9 -0
- data/spec/integration/command/project/project_1.cmd +1 -0
- data/spec/integration/command/project/project_1.stdout +9 -0
- data/spec/integration/command/quota/quota_0.cmd +1 -0
- data/spec/integration/command/quota/quota_0.stdout +16 -0
- data/spec/integration/command/rank/rank_1.cmd +1 -0
- data/spec/integration/command/rank/rank_1.stdout +10 -0
- data/spec/integration/command/rank/rank_2.cmd +1 -0
- data/spec/integration/command/rank/rank_2.stdout +10 -0
- data/spec/integration/command/rank/rank_3.cmd +1 -0
- data/spec/integration/command/rank/rank_3.stdout +10 -0
- data/spec/integration/command/rank/rank_4.cmd +1 -0
- data/spec/integration/command/rank/rank_4.stdout +6 -0
- data/spec/integration/command/rank/rank_5.cmd +1 -0
- data/spec/integration/command/rank/rank_5.stdout +6 -0
- data/spec/integration/command/rename/rename_0.cmd +1 -0
- data/spec/integration/command/rename/rename_0.stdout +9 -0
- data/spec/integration/command/restrict/restrict_0.cmd +1 -0
- data/spec/integration/command/restrict/restrict_0.stdout +6 -0
- data/spec/integration/command/restrict/restrict_1.cmd +1 -0
- data/spec/integration/command/restrict/restrict_1.stdout +6 -0
- data/spec/integration/command/show/show_base.cmd +1 -0
- data/spec/integration/command/show/show_base.stdout +9 -0
- data/spec/integration/command/show/show_conflictual.cmd +1 -0
- data/spec/integration/command/show/show_conflictual.stdout +5 -0
- data/spec/integration/command/show/show_rash.cmd +1 -0
- data/spec/integration/command/show/show_rash.stdout +5 -0
- data/spec/integration/command/show/show_rash_2.cmd +1 -0
- data/spec/integration/command/show/show_rash_2.stdout +5 -0
- data/spec/integration/command/show/show_yaml.cmd +1 -0
- data/spec/integration/command/show/show_yaml.stdout +22 -0
- data/spec/integration/command/sort/sort_0.cmd +1 -0
- data/spec/integration/command/sort/sort_0.stdout +9 -0
- data/spec/integration/command/sort/sort_1.cmd +1 -0
- data/spec/integration/command/sort/sort_1.stdout +9 -0
- data/spec/integration/command/summarize/summarize_0.cmd +1 -0
- data/spec/integration/command/summarize/summarize_0.stdout +8 -0
- data/spec/integration/command/ungroup/ungroup_0.cmd +1 -0
- data/spec/integration/command/ungroup/ungroup_0.stdout +16 -0
- data/spec/integration/command/union/union_0.cmd +1 -0
- data/spec/integration/command/union/union_0.stdout +9 -0
- data/spec/integration/command/unwrap/unwrap_0.cmd +1 -0
- data/spec/integration/command/unwrap/unwrap_0.stdout +9 -0
- data/spec/integration/command/wrap/wrap_0.cmd +1 -0
- data/spec/integration/command/wrap/wrap_0.stdout +9 -0
- data/spec/integration/semantics/test_join.alf +9 -0
- data/spec/integration/{src → semantics}/test_minus.alf +0 -0
- data/spec/integration/{src → semantics}/test_project.alf +0 -0
- data/spec/integration/semantics/test_rank.alf +34 -0
- data/spec/integration/test_command.rb +36 -0
- data/spec/integration/test_examples.rb +11 -22
- data/spec/integration/test_semantics.rb +40 -0
- data/spec/regression/alf_file/__FILE__.alf +2 -0
- data/spec/regression/alf_file/suppliers.rash +5 -0
- data/spec/regression/alf_file/test___FILE__.rb +17 -0
- data/spec/regression/heading/test_heading_with_date.rb +12 -0
- data/spec/regression/lispy/test_compile.rb +14 -0
- data/spec/regression/relation/test_relation_with_date.rb +12 -0
- data/spec/regression/restrict/test_restrict_with_keywords.rb +17 -0
- data/spec/shared/a_value.rb +12 -0
- data/spec/shared/an_operator_class.rb +35 -0
- data/spec/spec_helper.rb +12 -34
- data/spec/unit/assumptions/test_file.rb +17 -0
- data/spec/unit/{test_assumptions.rb → assumptions/test_instance_eval.rb} +1 -1
- data/spec/unit/assumptions/test_scoping.rb +29 -0
- data/spec/unit/environment/test_folder.rb +6 -1
- data/spec/unit/operator/relational/matching/test_hash_based.rb +60 -0
- data/spec/unit/operator/relational/not_matching/test_hash_based.rb +37 -0
- data/spec/unit/operator/relational/test_rank.rb +50 -0
- data/spec/unit/operator/test_relational.rb +3 -0
- data/spec/unit/reader/test_alf_file.rb +7 -4
- data/spec/unit/reader/test_initialize.rb +60 -0
- data/spec/unit/relation/test_relops.rb +4 -0
- data/spec/unit/relation/test_to_a.rb +41 -0
- data/spec/unit/renderer/test_initialize.rb +60 -0
- data/spec/unit/test_environment.rb +38 -0
- data/spec/unit/test_heading.rb +38 -0
- data/spec/unit/test_reader.rb +5 -0
- data/spec/unit/test_relation.rb +31 -1
- data/spec/unit/test_renderer.rb +1 -1
- data/spec/unit/{renderer/text → text}/test_cell.rb +1 -1
- data/spec/unit/{renderer/text → text}/test_row.rb +1 -1
- data/spec/unit/{renderer/text → text}/test_table.rb +1 -1
- data/spec/unit/tools/test_ordering_key.rb +13 -0
- data/spec/unit/tools/test_parse_commandline_args.rb +47 -0
- data/spec/unit/tools/test_tuple_handle.rb +34 -2
- data/spec/unit/tools/test_varargs.rb +16 -0
- data/tasks/{spec_test.rake → integration_test.rake} +4 -32
- data/tasks/regression_test.rake +52 -0
- data/tasks/unit_test.rake +33 -58
- metadata +326 -66
- data/examples/runall.sh +0 -26
- data/lib/alf/relation.rb +0 -118
- data/lib/alf/renderer/text.rb +0 -153
- data/lib/alf/renderer/yaml.rb +0 -22
- data/spec/integration/test_alf_specs.rb +0 -37
@@ -0,0 +1,32 @@
|
|
1
|
+
+------+-----------------+
|
2
|
+
| :sid | :supplying |
|
3
|
+
+------+-----------------+
|
4
|
+
| S1 | +------+------+ |
|
5
|
+
| | | :pid | :qty | |
|
6
|
+
| | +------+------+ |
|
7
|
+
| | | P1 | 300 | |
|
8
|
+
| | | P2 | 200 | |
|
9
|
+
| | | P3 | 400 | |
|
10
|
+
| | | P4 | 200 | |
|
11
|
+
| | | P5 | 100 | |
|
12
|
+
| | | P6 | 100 | |
|
13
|
+
| | +------+------+ |
|
14
|
+
| S2 | +------+------+ |
|
15
|
+
| | | :pid | :qty | |
|
16
|
+
| | +------+------+ |
|
17
|
+
| | | P1 | 300 | |
|
18
|
+
| | | P2 | 400 | |
|
19
|
+
| | +------+------+ |
|
20
|
+
| S3 | +------+------+ |
|
21
|
+
| | | :pid | :qty | |
|
22
|
+
| | +------+------+ |
|
23
|
+
| | | P2 | 200 | |
|
24
|
+
| | +------+------+ |
|
25
|
+
| S4 | +------+------+ |
|
26
|
+
| | | :pid | :qty | |
|
27
|
+
| | +------+------+ |
|
28
|
+
| | | P2 | 200 | |
|
29
|
+
| | | P4 | 300 | |
|
30
|
+
| | | P5 | 400 | |
|
31
|
+
| | +------+------+ |
|
32
|
+
+------+-----------------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text group --allbut supplies -- sid supplying
|
@@ -0,0 +1,32 @@
|
|
1
|
+
+------+-----------------+
|
2
|
+
| :sid | :supplying |
|
3
|
+
+------+-----------------+
|
4
|
+
| S1 | +------+------+ |
|
5
|
+
| | | :pid | :qty | |
|
6
|
+
| | +------+------+ |
|
7
|
+
| | | P1 | 300 | |
|
8
|
+
| | | P2 | 200 | |
|
9
|
+
| | | P3 | 400 | |
|
10
|
+
| | | P4 | 200 | |
|
11
|
+
| | | P5 | 100 | |
|
12
|
+
| | | P6 | 100 | |
|
13
|
+
| | +------+------+ |
|
14
|
+
| S2 | +------+------+ |
|
15
|
+
| | | :pid | :qty | |
|
16
|
+
| | +------+------+ |
|
17
|
+
| | | P1 | 300 | |
|
18
|
+
| | | P2 | 400 | |
|
19
|
+
| | +------+------+ |
|
20
|
+
| S3 | +------+------+ |
|
21
|
+
| | | :pid | :qty | |
|
22
|
+
| | +------+------+ |
|
23
|
+
| | | P2 | 200 | |
|
24
|
+
| | +------+------+ |
|
25
|
+
| S4 | +------+------+ |
|
26
|
+
| | | :pid | :qty | |
|
27
|
+
| | +------+------+ |
|
28
|
+
| | | P2 | 200 | |
|
29
|
+
| | | P4 | 300 | |
|
30
|
+
| | | P5 | 400 | |
|
31
|
+
| | +------+------+ |
|
32
|
+
+------+-----------------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text intersect suppliers suppliers
|
@@ -0,0 +1,9 @@
|
|
1
|
+
+------+-------+---------+--------+
|
2
|
+
| :sid | :name | :status | :city |
|
3
|
+
+------+-------+---------+--------+
|
4
|
+
| S1 | Smith | 20 | London |
|
5
|
+
| S2 | Jones | 10 | Paris |
|
6
|
+
| S3 | Blake | 30 | Paris |
|
7
|
+
| S4 | Clark | 20 | London |
|
8
|
+
| S5 | Adams | 30 | Athens |
|
9
|
+
+------+-------+---------+--------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text join suppliers supplies
|
@@ -0,0 +1,16 @@
|
|
1
|
+
+------+-------+---------+--------+------+------+
|
2
|
+
| :sid | :name | :status | :city | :pid | :qty |
|
3
|
+
+------+-------+---------+--------+------+------+
|
4
|
+
| S1 | Smith | 20 | London | P1 | 300 |
|
5
|
+
| S1 | Smith | 20 | London | P2 | 200 |
|
6
|
+
| S1 | Smith | 20 | London | P3 | 400 |
|
7
|
+
| S1 | Smith | 20 | London | P4 | 200 |
|
8
|
+
| S1 | Smith | 20 | London | P5 | 100 |
|
9
|
+
| S1 | Smith | 20 | London | P6 | 100 |
|
10
|
+
| S2 | Jones | 10 | Paris | P1 | 300 |
|
11
|
+
| S2 | Jones | 10 | Paris | P2 | 400 |
|
12
|
+
| S3 | Blake | 30 | Paris | P2 | 200 |
|
13
|
+
| S4 | Clark | 20 | London | P2 | 200 |
|
14
|
+
| S4 | Clark | 20 | London | P4 | 300 |
|
15
|
+
| S4 | Clark | 20 | London | P5 | 400 |
|
16
|
+
+------+-------+---------+--------+------+------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text matching suppliers supplies
|
@@ -0,0 +1,8 @@
|
|
1
|
+
+------+-------+---------+--------+
|
2
|
+
| :sid | :name | :status | :city |
|
3
|
+
+------+-------+---------+--------+
|
4
|
+
| S1 | Smith | 20 | London |
|
5
|
+
| S2 | Jones | 10 | Paris |
|
6
|
+
| S3 | Blake | 30 | Paris |
|
7
|
+
| S4 | Clark | 20 | London |
|
8
|
+
+------+-------+---------+--------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text minus suppliers suppliers
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text not-matching suppliers supplies
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text project suppliers -- name city
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text project --allbut suppliers -- name city
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text quota supplies -- --by=sid --order=qty position count sum_qty "sum(:qty)"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
+------+------+------+-----------+----------+
|
2
|
+
| :sid | :pid | :qty | :position | :sum_qty |
|
3
|
+
+------+------+------+-----------+----------+
|
4
|
+
| S1 | P6 | 100 | 1 | 100 |
|
5
|
+
| S1 | P5 | 100 | 2 | 200 |
|
6
|
+
| S1 | P2 | 200 | 3 | 400 |
|
7
|
+
| S1 | P4 | 200 | 4 | 600 |
|
8
|
+
| S1 | P1 | 300 | 5 | 900 |
|
9
|
+
| S1 | P3 | 400 | 6 | 1300 |
|
10
|
+
| S2 | P1 | 300 | 1 | 300 |
|
11
|
+
| S2 | P2 | 400 | 2 | 700 |
|
12
|
+
| S3 | P2 | 200 | 1 | 200 |
|
13
|
+
| S4 | P2 | 200 | 1 | 200 |
|
14
|
+
| S4 | P4 | 300 | 2 | 500 |
|
15
|
+
| S4 | P5 | 400 | 3 | 900 |
|
16
|
+
+------+------+------+-----------+----------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text rank parts --order=weight
|
@@ -0,0 +1,10 @@
|
|
1
|
+
+------+-------+--------+------------+--------+-------+
|
2
|
+
| :pid | :name | :color | :weight | :city | :rank |
|
3
|
+
+------+-------+--------+------------+--------+-------+
|
4
|
+
| P1 | Nut | Red | 12.0000000 | London | 0 |
|
5
|
+
| P5 | Cam | Blue | 12.0000000 | Paris | 0 |
|
6
|
+
| P4 | Screw | Red | 14.0000000 | London | 2 |
|
7
|
+
| P2 | Bolt | Green | 17.0000000 | Paris | 3 |
|
8
|
+
| P3 | Screw | Blue | 17.0000000 | Oslo | 3 |
|
9
|
+
| P6 | Cog | Red | 19.0000000 | London | 5 |
|
10
|
+
+------+-------+--------+------------+--------+-------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text rank parts --order=weight -- pos
|
@@ -0,0 +1,10 @@
|
|
1
|
+
+------+-------+--------+------------+--------+------+
|
2
|
+
| :pid | :name | :color | :weight | :city | :pos |
|
3
|
+
+------+-------+--------+------------+--------+------+
|
4
|
+
| P1 | Nut | Red | 12.0000000 | London | 0 |
|
5
|
+
| P5 | Cam | Blue | 12.0000000 | Paris | 0 |
|
6
|
+
| P4 | Screw | Red | 14.0000000 | London | 2 |
|
7
|
+
| P2 | Bolt | Green | 17.0000000 | Paris | 3 |
|
8
|
+
| P3 | Screw | Blue | 17.0000000 | Oslo | 3 |
|
9
|
+
| P6 | Cog | Red | 19.0000000 | London | 5 |
|
10
|
+
+------+-------+--------+------------+--------+------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text rank parts --order=weight,pid
|
@@ -0,0 +1,10 @@
|
|
1
|
+
+------+-------+--------+------------+--------+-------+
|
2
|
+
| :pid | :name | :color | :weight | :city | :rank |
|
3
|
+
+------+-------+--------+------------+--------+-------+
|
4
|
+
| P1 | Nut | Red | 12.0000000 | London | 0 |
|
5
|
+
| P5 | Cam | Blue | 12.0000000 | Paris | 1 |
|
6
|
+
| P4 | Screw | Red | 14.0000000 | London | 2 |
|
7
|
+
| P2 | Bolt | Green | 17.0000000 | Paris | 3 |
|
8
|
+
| P3 | Screw | Blue | 17.0000000 | Oslo | 4 |
|
9
|
+
| P6 | Cog | Red | 19.0000000 | London | 5 |
|
10
|
+
+------+-------+--------+------------+--------+-------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf rank parts --order=weight,desc -- position
|
@@ -0,0 +1,6 @@
|
|
1
|
+
{:pid => "P6", :name => "Cog", :color => "Red", :weight => 19.0, :city => "London", :position => 0}
|
2
|
+
{:pid => "P2", :name => "Bolt", :color => "Green", :weight => 17.0, :city => "Paris", :position => 1}
|
3
|
+
{:pid => "P3", :name => "Screw", :color => "Blue", :weight => 17.0, :city => "Oslo", :position => 1}
|
4
|
+
{:pid => "P4", :name => "Screw", :color => "Red", :weight => 14.0, :city => "London", :position => 3}
|
5
|
+
{:pid => "P5", :name => "Cam", :color => "Blue", :weight => 12.0, :city => "Paris", :position => 4}
|
6
|
+
{:pid => "P1", :name => "Nut", :color => "Red", :weight => 12.0, :city => "London", :position => 4}
|
@@ -0,0 +1 @@
|
|
1
|
+
alf rank parts --order=weight,desc,pid,asc -- position
|
@@ -0,0 +1,6 @@
|
|
1
|
+
{:pid => "P6", :name => "Cog", :color => "Red", :weight => 19.0, :city => "London", :position => 0}
|
2
|
+
{:pid => "P2", :name => "Bolt", :color => "Green", :weight => 17.0, :city => "Paris", :position => 1}
|
3
|
+
{:pid => "P3", :name => "Screw", :color => "Blue", :weight => 17.0, :city => "Oslo", :position => 2}
|
4
|
+
{:pid => "P4", :name => "Screw", :color => "Red", :weight => 14.0, :city => "London", :position => 3}
|
5
|
+
{:pid => "P1", :name => "Nut", :color => "Red", :weight => 12.0, :city => "London", :position => 4}
|
6
|
+
{:pid => "P5", :name => "Cam", :color => "Blue", :weight => 12.0, :city => "Paris", :position => 5}
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text rename suppliers -- name supplier_name city supplier_city
|
@@ -0,0 +1,9 @@
|
|
1
|
+
+------+----------------+---------+----------------+
|
2
|
+
| :sid | :supplier_name | :status | :supplier_city |
|
3
|
+
+------+----------------+---------+----------------+
|
4
|
+
| S1 | Smith | 20 | London |
|
5
|
+
| S2 | Jones | 10 | Paris |
|
6
|
+
| S3 | Blake | 30 | Paris |
|
7
|
+
| S4 | Clark | 20 | London |
|
8
|
+
| S5 | Adams | 30 | Athens |
|
9
|
+
+------+----------------+---------+----------------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text restrict suppliers -- "status > 20"
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text restrict suppliers -- city "'London'"
|
@@ -0,0 +1 @@
|
|
1
|
+
alf show suppliers
|
@@ -0,0 +1,9 @@
|
|
1
|
+
+------+-------+---------+--------+
|
2
|
+
| :sid | :name | :status | :city |
|
3
|
+
+------+-------+---------+--------+
|
4
|
+
| S1 | Smith | 20 | London |
|
5
|
+
| S2 | Jones | 10 | Paris |
|
6
|
+
| S3 | Blake | 30 | Paris |
|
7
|
+
| S4 | Clark | 20 | London |
|
8
|
+
| S5 | Adams | 30 | Athens |
|
9
|
+
+------+-------+---------+--------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --yaml show suppliers --rash
|
@@ -0,0 +1,5 @@
|
|
1
|
+
{:sid => "S1", :name => "Smith", :status => 20, :city => "London"}
|
2
|
+
{:sid => "S2", :name => "Jones", :status => 10, :city => "Paris"}
|
3
|
+
{:sid => "S3", :name => "Blake", :status => 30, :city => "Paris"}
|
4
|
+
{:sid => "S4", :name => "Clark", :status => 20, :city => "London"}
|
5
|
+
{:sid => "S5", :name => "Adams", :status => 30, :city => "Athens"}
|
@@ -0,0 +1 @@
|
|
1
|
+
alf show suppliers --rash
|
@@ -0,0 +1,5 @@
|
|
1
|
+
{:sid => "S1", :name => "Smith", :status => 20, :city => "London"}
|
2
|
+
{:sid => "S2", :name => "Jones", :status => 10, :city => "Paris"}
|
3
|
+
{:sid => "S3", :name => "Blake", :status => 30, :city => "Paris"}
|
4
|
+
{:sid => "S4", :name => "Clark", :status => 20, :city => "London"}
|
5
|
+
{:sid => "S5", :name => "Adams", :status => 30, :city => "Athens"}
|
@@ -0,0 +1 @@
|
|
1
|
+
alf -rdate extend suppliers -- date "Date.parse('2011-07-22')"
|
@@ -0,0 +1,5 @@
|
|
1
|
+
{:sid => "S1", :name => "Smith", :status => 20, :city => "London", :date => Marshal.load("\x04\bU:\tDate[\bU:\rRational[\ai\x03\xA9\xF1Ji\ai\x00i\x03\x19\x15#")}
|
2
|
+
{:sid => "S2", :name => "Jones", :status => 10, :city => "Paris", :date => Marshal.load("\x04\bU:\tDate[\bU:\rRational[\ai\x03\xA9\xF1Ji\ai\x00i\x03\x19\x15#")}
|
3
|
+
{:sid => "S3", :name => "Blake", :status => 30, :city => "Paris", :date => Marshal.load("\x04\bU:\tDate[\bU:\rRational[\ai\x03\xA9\xF1Ji\ai\x00i\x03\x19\x15#")}
|
4
|
+
{:sid => "S4", :name => "Clark", :status => 20, :city => "London", :date => Marshal.load("\x04\bU:\tDate[\bU:\rRational[\ai\x03\xA9\xF1Ji\ai\x00i\x03\x19\x15#")}
|
5
|
+
{:sid => "S5", :name => "Adams", :status => 30, :city => "Athens", :date => Marshal.load("\x04\bU:\tDate[\bU:\rRational[\ai\x03\xA9\xF1Ji\ai\x00i\x03\x19\x15#")}
|
@@ -0,0 +1 @@
|
|
1
|
+
alf show suppliers --yaml
|
@@ -0,0 +1,22 @@
|
|
1
|
+
---
|
2
|
+
- :sid: S1
|
3
|
+
:name: Smith
|
4
|
+
:status: 20
|
5
|
+
:city: London
|
6
|
+
- :sid: S2
|
7
|
+
:name: Jones
|
8
|
+
:status: 10
|
9
|
+
:city: Paris
|
10
|
+
- :sid: S3
|
11
|
+
:name: Blake
|
12
|
+
:status: 30
|
13
|
+
:city: Paris
|
14
|
+
- :sid: S4
|
15
|
+
:name: Clark
|
16
|
+
:status: 20
|
17
|
+
:city: London
|
18
|
+
- :sid: S5
|
19
|
+
:name: Adams
|
20
|
+
:status: 30
|
21
|
+
:city: Athens
|
22
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text sort suppliers -- name asc
|
@@ -0,0 +1,9 @@
|
|
1
|
+
+------+-------+---------+--------+
|
2
|
+
| :sid | :name | :status | :city |
|
3
|
+
+------+-------+---------+--------+
|
4
|
+
| S5 | Adams | 30 | Athens |
|
5
|
+
| S3 | Blake | 30 | Paris |
|
6
|
+
| S4 | Clark | 20 | London |
|
7
|
+
| S2 | Jones | 10 | Paris |
|
8
|
+
| S1 | Smith | 20 | London |
|
9
|
+
+------+-------+---------+--------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text sort suppliers -- city desc name asc
|
@@ -0,0 +1,9 @@
|
|
1
|
+
+------+-------+---------+--------+
|
2
|
+
| :sid | :name | :status | :city |
|
3
|
+
+------+-------+---------+--------+
|
4
|
+
| S3 | Blake | 30 | Paris |
|
5
|
+
| S2 | Jones | 10 | Paris |
|
6
|
+
| S4 | Clark | 20 | London |
|
7
|
+
| S1 | Smith | 20 | London |
|
8
|
+
| S5 | Adams | 30 | Athens |
|
9
|
+
+------+-------+---------+--------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text summarize supplies -- --by=sid total_qty "sum(:qty)"
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text ungroup group -- supplying
|
@@ -0,0 +1,16 @@
|
|
1
|
+
+------+------+------+
|
2
|
+
| :sid | :pid | :qty |
|
3
|
+
+------+------+------+
|
4
|
+
| S1 | P1 | 300 |
|
5
|
+
| S1 | P2 | 200 |
|
6
|
+
| S1 | P3 | 400 |
|
7
|
+
| S1 | P4 | 200 |
|
8
|
+
| S1 | P5 | 100 |
|
9
|
+
| S1 | P6 | 100 |
|
10
|
+
| S2 | P1 | 300 |
|
11
|
+
| S2 | P2 | 400 |
|
12
|
+
| S3 | P2 | 200 |
|
13
|
+
| S4 | P2 | 200 |
|
14
|
+
| S4 | P4 | 300 |
|
15
|
+
| S4 | P5 | 400 |
|
16
|
+
+------+------+------+
|
@@ -0,0 +1 @@
|
|
1
|
+
alf --text union suppliers suppliers
|
@@ -0,0 +1,9 @@
|
|
1
|
+
+------+-------+---------+--------+
|
2
|
+
| :sid | :name | :status | :city |
|
3
|
+
+------+-------+---------+--------+
|
4
|
+
| S1 | Smith | 20 | London |
|
5
|
+
| S2 | Jones | 10 | Paris |
|
6
|
+
| S3 | Blake | 30 | Paris |
|
7
|
+
| S4 | Clark | 20 | London |
|
8
|
+
| S5 | Adams | 30 | Athens |
|
9
|
+
+------+-------+---------+--------+
|