alf-shell 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -2
- data/Gemfile.lock +29 -10
- data/bin/alf +2 -0
- data/doc/man/alf-explain.man +22 -0
- data/doc/man/alf-metadata.man +13 -0
- data/doc/man/alf-show.man +16 -0
- data/doc/man/alf.man +77 -0
- data/doc/man/allbut.man +39 -0
- data/doc/man/among.man +25 -0
- data/doc/man/avg.man +37 -0
- data/doc/man/between.man +24 -0
- data/doc/man/concat.man +55 -0
- data/doc/man/contradiction.man +26 -0
- data/doc/man/count.man +20 -0
- data/doc/man/eq.man +29 -0
- data/doc/man/extend.man +33 -0
- data/doc/man/frame.man +60 -0
- data/doc/man/group.man +51 -0
- data/doc/man/gt.man +30 -0
- data/doc/man/gte.man +30 -0
- data/doc/man/intersect.man +54 -0
- data/doc/man/join.man +84 -0
- data/doc/man/lt.man +30 -0
- data/doc/man/lte.man +30 -0
- data/doc/man/matching.man +73 -0
- data/doc/man/max.man +36 -0
- data/doc/man/min.man +36 -0
- data/doc/man/minus.man +54 -0
- data/doc/man/native.man +32 -0
- data/doc/man/neq.man +29 -0
- data/doc/man/not_matching.man +51 -0
- data/doc/man/page.man +60 -0
- data/doc/man/project.man +36 -0
- data/doc/man/rank.man +42 -0
- data/doc/man/rename.man +29 -0
- data/doc/man/restrict.man +38 -0
- data/doc/man/stddev.man +37 -0
- data/doc/man/sum.man +37 -0
- data/doc/man/summarize.man +45 -0
- data/doc/man/tautology.man +26 -0
- data/doc/man/ungroup.man +30 -0
- data/doc/man/union.man +55 -0
- data/doc/man/unwrap.man +37 -0
- data/doc/man/variance.man +37 -0
- data/doc/man/wrap.man +37 -0
- data/doc/txt/alf-explain.man +22 -0
- data/doc/txt/alf-metadata.man +16 -0
- data/doc/txt/alf-show.man +19 -0
- data/doc/txt/alf.man +80 -0
- data/doc/txt/allbut.txt +31 -0
- data/doc/txt/among.txt +20 -0
- data/doc/txt/avg.txt +22 -0
- data/doc/txt/between.txt +19 -0
- data/doc/txt/concat.txt +31 -0
- data/doc/txt/contradiction.txt +15 -0
- data/doc/txt/count.txt +14 -0
- data/doc/txt/eq.txt +19 -0
- data/doc/txt/extend.txt +29 -0
- data/doc/txt/frame.txt +48 -0
- data/doc/txt/group.txt +37 -0
- data/doc/txt/gt.txt +20 -0
- data/doc/txt/gte.txt +20 -0
- data/doc/txt/intersect.txt +42 -0
- data/doc/txt/join.txt +65 -0
- data/doc/txt/lt.txt +20 -0
- data/doc/txt/lte.txt +20 -0
- data/doc/txt/matching.txt +54 -0
- data/doc/txt/max.txt +21 -0
- data/doc/txt/min.txt +21 -0
- data/doc/txt/minus.txt +42 -0
- data/doc/txt/native.txt +27 -0
- data/doc/txt/neq.txt +19 -0
- data/doc/txt/not_matching.txt +39 -0
- data/doc/txt/page.txt +48 -0
- data/doc/txt/project.txt +28 -0
- data/doc/txt/rank.txt +34 -0
- data/doc/txt/rename.txt +25 -0
- data/doc/txt/restrict.txt +26 -0
- data/doc/txt/stddev.txt +22 -0
- data/doc/txt/sum.txt +22 -0
- data/doc/txt/summarize.txt +33 -0
- data/doc/txt/tautology.txt +15 -0
- data/doc/txt/ungroup.txt +26 -0
- data/doc/txt/union.txt +43 -0
- data/doc/txt/unwrap.txt +29 -0
- data/doc/txt/variance.txt +22 -0
- data/doc/txt/wrap.txt +29 -0
- data/lib/alf/shell.rb +2 -32
- data/lib/alf/shell/alfrc.rb +3 -0
- data/lib/alf/shell/command.rb +2 -18
- data/lib/alf/shell/command/explain.rb +37 -0
- data/lib/alf/shell/command/help.rb +3 -21
- data/lib/alf/shell/command/main.rb +20 -78
- data/lib/alf/shell/command/metadata.rb +32 -0
- data/lib/alf/shell/command/show.rb +17 -5
- data/lib/alf/shell/support.rb +21 -13
- data/lib/alf/shell/version.rb +1 -1
- data/spec/integration/explain/explain.cmd +1 -0
- data/spec/integration/explain/explain.stdout +11 -0
- data/spec/integration/show/group.alf +2 -0
- data/spec/integration/show/show_alf.cmd +1 -0
- data/spec/integration/{group/group_0.stdout → show/show_alf.stdout} +0 -0
- data/tasks/doc.rake +4 -0
- metadata +116 -178
- data/doc/commands/exec.md +0 -16
- data/doc/commands/help.md +0 -11
- data/doc/commands/main.md +0 -33
- data/doc/commands/show.md +0 -12
- data/doc/operators/non_relational/autonum.md +0 -23
- data/doc/operators/non_relational/clip.md +0 -31
- data/doc/operators/non_relational/coerce.md +0 -15
- data/doc/operators/non_relational/compact.md +0 -20
- data/doc/operators/non_relational/defaults.md +0 -32
- data/doc/operators/non_relational/generator.md +0 -20
- data/doc/operators/non_relational/sort.md +0 -24
- data/doc/operators/non_relational/type-safe.md +0 -20
- data/doc/operators/relational/extend.md +0 -18
- data/doc/operators/relational/frame.md +0 -26
- data/doc/operators/relational/group.md +0 -27
- data/doc/operators/relational/hierarchize.md +0 -14
- data/doc/operators/relational/infer-heading.md +0 -20
- data/doc/operators/relational/intersect.md +0 -13
- data/doc/operators/relational/join.md +0 -28
- data/doc/operators/relational/matching.md +0 -24
- data/doc/operators/relational/minus.md +0 -12
- data/doc/operators/relational/not-matching.md +0 -20
- data/doc/operators/relational/page.md +0 -31
- data/doc/operators/relational/project.md +0 -28
- data/doc/operators/relational/quota.md +0 -21
- data/doc/operators/relational/rank.md +0 -27
- data/doc/operators/relational/rename.md +0 -17
- data/doc/operators/relational/restrict.md +0 -25
- data/doc/operators/relational/summarize.md +0 -25
- data/doc/operators/relational/ungroup.md +0 -20
- data/doc/operators/relational/union.md +0 -14
- data/doc/operators/relational/unwrap.md +0 -20
- data/doc/operators/relational/wrap.md +0 -24
- data/lib/alf/shell/command/exec.rb +0 -16
- data/lib/alf/shell/doc_manager.rb +0 -84
- data/lib/alf/shell/ext/signature.rb +0 -45
- data/lib/alf/shell/from_argv.rb +0 -84
- data/lib/alf/shell/operator.rb +0 -63
- data/spec/integration/__database__/group.alf +0 -3
- data/spec/integration/alf/alf_e.cmd +0 -1
- data/spec/integration/alf/alf_e.stdout +0 -4
- data/spec/integration/alf/alf_help.cmd +0 -1
- data/spec/integration/alf/alf_help.stdout +0 -76
- data/spec/integration/alf/alf_r.cmd +0 -1
- data/spec/integration/alf/alf_r.stdout +0 -5
- data/spec/integration/autonum/autonum_0.cmd +0 -1
- data/spec/integration/autonum/autonum_0.stdout +0 -9
- data/spec/integration/autonum/autonum_1.cmd +0 -1
- data/spec/integration/autonum/autonum_1.stdout +0 -9
- data/spec/integration/clip/clip_0.cmd +0 -1
- data/spec/integration/clip/clip_0.stdout +0 -9
- data/spec/integration/clip/clip_1.cmd +0 -1
- data/spec/integration/clip/clip_1.stdout +0 -9
- data/spec/integration/coerce/coerce_1.cmd +0 -1
- data/spec/integration/coerce/coerce_1.stdout +0 -5
- data/spec/integration/compact/compact_0.cmd +0 -1
- data/spec/integration/compact/compact_0.stdout +0 -9
- data/spec/integration/defaults/defaults_0.cmd +0 -1
- data/spec/integration/defaults/defaults_0.stdout +0 -9
- data/spec/integration/defaults/defaults_1.cmd +0 -1
- data/spec/integration/defaults/defaults_1.stdout +0 -9
- data/spec/integration/defaults/defaults_2.cmd +0 -1
- data/spec/integration/defaults/defaults_2.stdout +0 -9
- data/spec/integration/extend/extend_0.cmd +0 -1
- data/spec/integration/extend/extend_0.stdout +0 -16
- data/spec/integration/frame/frame_0.cmd +0 -1
- data/spec/integration/frame/frame_0.stdout +0 -6
- data/spec/integration/generator/generator_1.cmd +0 -1
- data/spec/integration/generator/generator_1.stdout +0 -10
- data/spec/integration/generator/generator_2.cmd +0 -1
- data/spec/integration/generator/generator_2.stdout +0 -5
- data/spec/integration/generator/generator_3.cmd +0 -1
- data/spec/integration/generator/generator_3.stdout +0 -5
- data/spec/integration/group/group_0.cmd +0 -1
- data/spec/integration/group/group_1.cmd +0 -1
- data/spec/integration/group/group_1.stdout +0 -32
- data/spec/integration/help/help_1.cmd +0 -1
- data/spec/integration/help/help_1.stdout +0 -12
- data/spec/integration/intersect/intersect_0.cmd +0 -1
- data/spec/integration/intersect/intersect_0.stdout +0 -9
- data/spec/integration/join/join_0.cmd +0 -1
- data/spec/integration/join/join_0.stdout +0 -16
- data/spec/integration/matching/matching_0.cmd +0 -1
- data/spec/integration/matching/matching_0.stdout +0 -8
- data/spec/integration/minus/minus_0.cmd +0 -1
- data/spec/integration/minus/minus_0.stdout +0 -4
- data/spec/integration/not-matching/not-matching_0.cmd +0 -1
- data/spec/integration/not-matching/not-matching_0.stdout +0 -5
- data/spec/integration/page/page_0.cmd +0 -1
- data/spec/integration/page/page_0.stdout +0 -6
- data/spec/integration/project/project_0.cmd +0 -1
- data/spec/integration/project/project_0.stdout +0 -9
- data/spec/integration/project/project_1.cmd +0 -1
- data/spec/integration/project/project_1.stdout +0 -9
- data/spec/integration/quota/quota_0.cmd +0 -1
- data/spec/integration/quota/quota_0.stdout +0 -16
- data/spec/integration/rank/rank_1.cmd +0 -1
- data/spec/integration/rank/rank_1.stdout +0 -10
- data/spec/integration/rank/rank_2.cmd +0 -1
- data/spec/integration/rank/rank_2.stdout +0 -10
- data/spec/integration/rank/rank_3.cmd +0 -1
- data/spec/integration/rank/rank_3.stdout +0 -10
- data/spec/integration/rank/rank_4.cmd +0 -1
- data/spec/integration/rank/rank_4.stdout +0 -6
- data/spec/integration/rank/rank_5.cmd +0 -1
- data/spec/integration/rank/rank_5.stdout +0 -6
- data/spec/integration/rename/rename_0.cmd +0 -1
- data/spec/integration/rename/rename_0.stdout +0 -9
- data/spec/integration/restrict/restrict_0.cmd +0 -1
- data/spec/integration/restrict/restrict_0.stdout +0 -6
- data/spec/integration/restrict/restrict_1.cmd +0 -1
- data/spec/integration/restrict/restrict_1.stdout +0 -6
- data/spec/integration/sort/sort_0.cmd +0 -1
- data/spec/integration/sort/sort_0.stdout +0 -9
- data/spec/integration/sort/sort_1.cmd +0 -1
- data/spec/integration/sort/sort_1.stdout +0 -9
- data/spec/integration/sort/sort_2.cmd +0 -1
- data/spec/integration/sort/sort_2.stdout +0 -9
- data/spec/integration/sort/sort_3.cmd +0 -1
- data/spec/integration/sort/sort_3.stdout +0 -9
- data/spec/integration/summarize/summarize_0.cmd +0 -1
- data/spec/integration/summarize/summarize_0.stdout +0 -8
- data/spec/integration/union/union_0.cmd +0 -1
- data/spec/integration/union/union_0.stdout +0 -9
- data/spec/integration/unwrap/unwrap_0.cmd +0 -1
- data/spec/integration/unwrap/unwrap_0.stdout +0 -9
- data/spec/integration/wrap/wrap_0.cmd +0 -1
- data/spec/integration/wrap/wrap_0.stdout +0 -9
- data/spec/unit/doc_manager/dynamic.md +0 -1
- data/spec/unit/doc_manager/example.md +0 -1
- data/spec/unit/doc_manager/example_1.txt +0 -11
- data/spec/unit/doc_manager/static.md +0 -1
- data/spec/unit/doc_manager/test_call.rb +0 -41
- data/spec/unit/ext/signature/test_argv2args.rb +0 -82
- data/spec/unit/ext/signature/test_to_shell.rb +0 -103
- data/spec/unit/from_argv/test_to_attr_list.rb +0 -30
- data/spec/unit/from_argv/test_to_attr_name.rb +0 -27
- data/spec/unit/from_argv/test_to_boolean.rb +0 -32
- data/spec/unit/from_argv/test_to_heading.rb +0 -37
- data/spec/unit/from_argv/test_to_ordering.rb +0 -28
- data/spec/unit/from_argv/test_to_predicate.rb +0 -26
- data/spec/unit/from_argv/test_to_renaming.rb +0 -23
- data/spec/unit/from_argv/test_to_size.rb +0 -32
- data/spec/unit/from_argv/test_to_summarization.rb +0 -19
- data/spec/unit/from_argv/test_to_tuple_computation.rb +0 -18
- data/spec/unit/from_argv/test_to_tuple_expression.rb +0 -38
- data/spec/unit/main/test_class_methods.rb +0 -44
- data/spec/unit/operator/test_autonum.rb +0 -28
- data/spec/unit/operator/test_clip.rb +0 -29
- data/spec/unit/operator/test_coerce.rb +0 -22
- data/spec/unit/operator/test_compact.rb +0 -16
- data/spec/unit/operator/test_defaults.rb +0 -29
- data/spec/unit/operator/test_extend.rb +0 -21
- data/spec/unit/operator/test_generator.rb +0 -37
- data/spec/unit/operator/test_group.rb +0 -32
- data/spec/unit/operator/test_infer_heading.rb +0 -16
- data/spec/unit/operator/test_intersect.rb +0 -18
- data/spec/unit/operator/test_join.rb +0 -18
- data/spec/unit/operator/test_matching.rb +0 -18
- data/spec/unit/operator/test_minus.rb +0 -18
- data/spec/unit/operator/test_not_matching.rb +0 -18
- data/spec/unit/operator/test_project.rb +0 -38
- data/spec/unit/operator/test_quota.rb +0 -23
- data/spec/unit/operator/test_rank.rb +0 -30
- data/spec/unit/operator/test_rename.rb +0 -21
- data/spec/unit/operator/test_restrict.rb +0 -36
- data/spec/unit/operator/test_sort.rb +0 -49
- data/spec/unit/operator/test_summarize.rb +0 -30
- data/spec/unit/operator/test_ungroup.rb +0 -28
- data/spec/unit/operator/test_union.rb +0 -18
- data/spec/unit/operator/test_unwrap.rb +0 -28
- data/spec/unit/operator/test_wrap.rb +0 -30
data/Gemfile
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
group :runtime do
|
4
|
-
gem "
|
5
|
-
|
4
|
+
gem "quickl", "~> 0.4.3"
|
5
|
+
|
6
|
+
gem "alf-shell", path: "."
|
7
|
+
gem "alf-core", path: "../alf-core"
|
6
8
|
end
|
7
9
|
|
8
10
|
group :development do
|
11
|
+
gem "alf-doc", path: "../alf-doc"
|
9
12
|
gem "rake", "~> 10.1"
|
10
13
|
gem "rspec", "~> 2.14"
|
11
14
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,31 @@
|
|
1
|
-
|
2
|
-
remote:
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
3
|
specs:
|
4
|
-
alf-
|
4
|
+
alf-shell (0.15.0)
|
5
|
+
alf-core (~> 0.15.0)
|
6
|
+
quickl (~> 0.4.3)
|
7
|
+
|
8
|
+
PATH
|
9
|
+
remote: ../alf-core
|
10
|
+
specs:
|
11
|
+
alf-core (0.15.0)
|
5
12
|
domain (~> 1.0)
|
6
13
|
myrrha (~> 3.0)
|
7
14
|
path (~> 1.3)
|
8
|
-
sexpr (~> 0.
|
15
|
+
sexpr (~> 0.6.0)
|
16
|
+
|
17
|
+
PATH
|
18
|
+
remote: ../alf-doc
|
19
|
+
specs:
|
20
|
+
alf-doc (0.15.0)
|
21
|
+
alf-core (~> 0.15.0)
|
22
|
+
|
23
|
+
GEM
|
24
|
+
remote: http://rubygems.org/
|
25
|
+
specs:
|
9
26
|
diff-lcs (1.2.4)
|
10
27
|
domain (1.0.0)
|
11
|
-
highline (1.6.
|
28
|
+
highline (1.6.20)
|
12
29
|
myrrha (3.0.0)
|
13
30
|
domain (~> 1.0)
|
14
31
|
path (1.3.3)
|
@@ -18,17 +35,19 @@ GEM
|
|
18
35
|
rspec-core (~> 2.14.0)
|
19
36
|
rspec-expectations (~> 2.14.0)
|
20
37
|
rspec-mocks (~> 2.14.0)
|
21
|
-
rspec-core (2.14.
|
22
|
-
rspec-expectations (2.14.
|
38
|
+
rspec-core (2.14.7)
|
39
|
+
rspec-expectations (2.14.3)
|
23
40
|
diff-lcs (>= 1.1.3, < 2.0)
|
24
|
-
rspec-mocks (2.14.
|
25
|
-
sexpr (0.
|
41
|
+
rspec-mocks (2.14.4)
|
42
|
+
sexpr (0.6.0)
|
26
43
|
|
27
44
|
PLATFORMS
|
28
45
|
ruby
|
29
46
|
|
30
47
|
DEPENDENCIES
|
31
|
-
alf-core
|
48
|
+
alf-core!
|
49
|
+
alf-doc!
|
50
|
+
alf-shell!
|
32
51
|
highline (~> 1.6)
|
33
52
|
quickl (~> 0.4.3)
|
34
53
|
rake (~> 10.1)
|
data/bin/alf
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
.TH alf\-explain
|
2
|
+
.PP
|
3
|
+
Show the logical (optimizer) and physical (compiler) plans of a query.
|
4
|
+
.SH Synopsis
|
5
|
+
.PP
|
6
|
+
\fB\fCalf\fR explain \fIQUERY\fP
|
7
|
+
.SH Description
|
8
|
+
.PP
|
9
|
+
This command prints the logical and physical query plans for QUERY to
|
10
|
+
standard output:
|
11
|
+
.RS
|
12
|
+
.IP \(bu 2
|
13
|
+
The logical plan is post\-optimizer and allows checking that the latter
|
14
|
+
performs correctly.
|
15
|
+
.IP \(bu 2
|
16
|
+
The physical plan provides information about compilation. In particular it
|
17
|
+
provides feedback about the effective delegation to underlying database
|
18
|
+
engines, as well as involved SQL queries.
|
19
|
+
.RE
|
20
|
+
.SH Example
|
21
|
+
.PP
|
22
|
+
\fB\fCalf\fR \fB\fC--examples\fR explain "restrict(suppliers, city: 'London')"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
.TH alf\-metadata
|
2
|
+
.PP
|
3
|
+
Show metadata about a query, such as heading and candidate keys.
|
4
|
+
.SH Synopsis
|
5
|
+
.PP
|
6
|
+
\fB\fCalf\fR metadata \fIQUERY\fP
|
7
|
+
.SH Description
|
8
|
+
.PP
|
9
|
+
This command prints some metadata (e.g. heading, keys, etc.) about the
|
10
|
+
expression passed as first argument.
|
11
|
+
.SH Example
|
12
|
+
.PP
|
13
|
+
\fB\fCalf\fR \fB\fC--examples\fR metadata "restrict(suppliers, city: 'London')"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
.TH alf\-show
|
2
|
+
.PP
|
3
|
+
Evaluates a query and shows the result.
|
4
|
+
.SH Synopsis
|
5
|
+
.PP
|
6
|
+
\fB\fCalf\fR [\fB\fC--csv\fR|\fB\fC--json\fR\&...] show \fIQUERY\fP \-\- [\fIORDERING\fP]
|
7
|
+
.SH Description
|
8
|
+
.PP
|
9
|
+
Take a query argument and execute it against the current database (according
|
10
|
+
to options passed to the \fB\fCalf\fR main command). Show the result on standard
|
11
|
+
output. The format (e.g. json) may be specified through \fB\fCalf\fR main options.
|
12
|
+
.PP
|
13
|
+
When an ordering is specified, tuples are rendered in the order specified.
|
14
|
+
.SH Example
|
15
|
+
.PP
|
16
|
+
\fB\fCalf\fR \fB\fC--examples\fR show "restrict(suppliers, city: 'London')" \-\- name DESC
|
data/doc/man/alf.man
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
.TH alf
|
2
|
+
.PP
|
3
|
+
Relational algebra at your fingertips
|
4
|
+
.SH Synopsis
|
5
|
+
.PP
|
6
|
+
\fB\fCalf\fR [\fB\fC--version\fR] [\fB\fC--help\fR]
|
7
|
+
.PP
|
8
|
+
\fB\fCalf\fR \fIFILE.alf\fP
|
9
|
+
.PP
|
10
|
+
\fB\fCalf\fR show \fIQUERY\fP
|
11
|
+
.PP
|
12
|
+
\fB\fCalf\fR explain \fIQUERY\fP
|
13
|
+
.PP
|
14
|
+
\fB\fCalf\fR help \fIOPERATOR\fP
|
15
|
+
.SH Options
|
16
|
+
.TP
|
17
|
+
\fB\fC--rash\fR
|
18
|
+
Render output as ruby hashes
|
19
|
+
.TP
|
20
|
+
\fB\fC--text\fR
|
21
|
+
Render output as a text table
|
22
|
+
.TP
|
23
|
+
\fB\fC--yaml\fR
|
24
|
+
Render output in YAML
|
25
|
+
.TP
|
26
|
+
\fB\fC--json\fR
|
27
|
+
Render output in JSON
|
28
|
+
.TP
|
29
|
+
\fB\fC--csv\fR
|
30
|
+
Render output in CSV
|
31
|
+
.TP
|
32
|
+
\fB\fC--examples\fR
|
33
|
+
Use the suppliers and parts example database
|
34
|
+
.TP
|
35
|
+
\fB\fC--db=DB\fR
|
36
|
+
Set the database (adapter) to use. Recognized values can be
|
37
|
+
folders with recognized files, or an URL to a SQL database
|
38
|
+
(e.g. postgres://user:pass@host/database)
|
39
|
+
.TP
|
40
|
+
\fB\fC--stdin=READER\fR
|
41
|
+
Specify the kind of reader when reading on standard input
|
42
|
+
(i.e. rash, csv, json, ruby, or yaml)
|
43
|
+
.TP
|
44
|
+
\fB\fC-Idirectory\fR
|
45
|
+
Specify $LOAD_PATH directory (may be used more than once)
|
46
|
+
.TP
|
47
|
+
\fB\fC-rlibrary\fR
|
48
|
+
Require the specified ruby library, before executing alf
|
49
|
+
.TP
|
50
|
+
\fB\fC--ff=FORMAT\fR
|
51
|
+
Specify the floating point format
|
52
|
+
.TP
|
53
|
+
\fB\fC--[no-]pretty\fR
|
54
|
+
Enable/disable pretty print best effort
|
55
|
+
.TP
|
56
|
+
\fB\fC-h\fR, \fB\fC--help\fR
|
57
|
+
Show this help
|
58
|
+
.TP
|
59
|
+
\fB\fC-v\fR, \fB\fC--version\fR
|
60
|
+
Show version and copyright
|
61
|
+
.SH Commands
|
62
|
+
.TP
|
63
|
+
\fB\fChelp\fR
|
64
|
+
Shows help about a specific command, relational operator, aggregator,
|
65
|
+
or predicate.
|
66
|
+
.TP
|
67
|
+
\fB\fCshow\fR
|
68
|
+
Evaluates a query and shows the result in a specified format.
|
69
|
+
.TP
|
70
|
+
\fB\fCmetadata\fR
|
71
|
+
Show metadata for a query (heading, keys).
|
72
|
+
.TP
|
73
|
+
\fB\fCexplain\fR
|
74
|
+
Show the logical (optimizer) and physical (compiler) plans of a query.
|
75
|
+
.PP
|
76
|
+
See \fB\fCalf help COMMAND\fR for details about a specific command or \fB\fCalf help
|
77
|
+
OPERATOR\fR for documentation of a relational operator.
|
data/doc/man/allbut.man
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
.TH Allbut
|
2
|
+
.PP
|
3
|
+
Projects a subset of attributes away.
|
4
|
+
.SH Signature
|
5
|
+
.PP
|
6
|
+
.RS
|
7
|
+
.nf
|
8
|
+
allbut(operand: Relation, attributes: AttrList) -> Relation
|
9
|
+
.fi
|
10
|
+
.RE
|
11
|
+
.SH Examples
|
12
|
+
.PP
|
13
|
+
.RS
|
14
|
+
.nf
|
15
|
+
allbut(suppliers, [:city])
|
16
|
+
.fi
|
17
|
+
.RE
|
18
|
+
.SH Description
|
19
|
+
.PP
|
20
|
+
Computes the relation obtained by removing a subset of attributes from
|
21
|
+
\fB\fCoperand\fR tuples.
|
22
|
+
.PP
|
23
|
+
This operator is the inverse of \fB\fCproject\fR\&. While the latter \fIkeeps\fP
|
24
|
+
attributes, this one \fIremoves\fP them. \fB\fCproject\fR actually supports an allbut
|
25
|
+
variant, which is equivalent to this operator. In other words, this
|
26
|
+
operator can be understood as follows:
|
27
|
+
.PP
|
28
|
+
.RS
|
29
|
+
.nf
|
30
|
+
def allbut(operand, attributes)
|
31
|
+
project(operand, attributes, allbut: true)
|
32
|
+
end
|
33
|
+
allbut(suppliers, [:city, :status])
|
34
|
+
.fi
|
35
|
+
.RE
|
36
|
+
.SH Implementation notes
|
37
|
+
.PP
|
38
|
+
Unlike SQL, this operator ALWAYS remove duplicates. There is no way, in
|
39
|
+
Alf, to compute \fIbags\fP of tuples.
|
data/doc/man/among.man
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
.TH Among
|
2
|
+
.PP
|
3
|
+
Among a set of values
|
4
|
+
.SH Signature
|
5
|
+
.PP
|
6
|
+
.RS
|
7
|
+
.nf
|
8
|
+
among(val: Alpha|AttrName, vals: Set<Alpha>) -> Predicate
|
9
|
+
.fi
|
10
|
+
.RE
|
11
|
+
.SH Examples
|
12
|
+
.PP
|
13
|
+
.RS
|
14
|
+
.nf
|
15
|
+
among(:status, [10, 30])
|
16
|
+
.fi
|
17
|
+
.RE
|
18
|
+
.SH Description
|
19
|
+
.PP
|
20
|
+
This predicates checks whether \fB\fCval\fR belongs to the set of values \fB\fCvals\fR\&.
|
21
|
+
.SH Implementation notes
|
22
|
+
.PP
|
23
|
+
The set \fB\fCvals\fR may only contain pure values, attribute names are not
|
24
|
+
supported. Any enumerable of such values is supported in practice, e.g.
|
25
|
+
an Array literal.
|
data/doc/man/avg.man
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
.TH Avg
|
2
|
+
.PP
|
3
|
+
Average
|
4
|
+
.SH Signature
|
5
|
+
.PP
|
6
|
+
.RS
|
7
|
+
.nf
|
8
|
+
avg(expr: AttrName|(Tuple->Numeric)) -> Aggregator
|
9
|
+
.fi
|
10
|
+
.RE
|
11
|
+
.SH Examples
|
12
|
+
.PP
|
13
|
+
.RS
|
14
|
+
.nf
|
15
|
+
avg(:qty)
|
16
|
+
.fi
|
17
|
+
.RE
|
18
|
+
.PP
|
19
|
+
.RS
|
20
|
+
.nf
|
21
|
+
avg{|t| t.qty * t.price }
|
22
|
+
.fi
|
23
|
+
.RE
|
24
|
+
.PP
|
25
|
+
.RS
|
26
|
+
.nf
|
27
|
+
avg(->(t){ t.qty * t.price })
|
28
|
+
.fi
|
29
|
+
.RE
|
30
|
+
.SH Description
|
31
|
+
.PP
|
32
|
+
Aggregates through \fB\fCv1 + v2 + ... + vn / n\fR\&.
|
33
|
+
.SH Implementation notes
|
34
|
+
.PP
|
35
|
+
This aggregate function should only be used with numeric types. As of
|
36
|
+
current Alf version, it does not aggregate empty sets correctly on
|
37
|
+
non\-numeric data types.
|
data/doc/man/between.man
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
.TH Between
|
2
|
+
.PP
|
3
|
+
Between (inclusive)
|
4
|
+
.SH Signature
|
5
|
+
.PP
|
6
|
+
.RS
|
7
|
+
.nf
|
8
|
+
between(val: Alpha|AttrName, min: Alpha|AttrName, max: Alpha|AttrName) -> Predicate
|
9
|
+
.fi
|
10
|
+
.RE
|
11
|
+
.SH Examples
|
12
|
+
.PP
|
13
|
+
.RS
|
14
|
+
.nf
|
15
|
+
between(:status, 10, 30)
|
16
|
+
.fi
|
17
|
+
.RE
|
18
|
+
.SH Description
|
19
|
+
.PP
|
20
|
+
This predicates checks whether a value (\fB\fCval\fR) is between two bounds \fB\fCmin\fR
|
21
|
+
and \fB\fCmax\fR, inclusive on both sides.
|
22
|
+
.SH Implementation notes
|
23
|
+
.PP
|
24
|
+
This predicate is equivalent to \fB\fCgte(_val_,_min_) & lte(_val_,_max_)\fR\&.
|
data/doc/man/concat.man
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
.TH Concat
|
2
|
+
.PP
|
3
|
+
String concatenation
|
4
|
+
.SH Signature
|
5
|
+
.PP
|
6
|
+
.RS
|
7
|
+
.nf
|
8
|
+
concat(expr: AttrName|(Tuple->Numeric)) -> Aggregator
|
9
|
+
.fi
|
10
|
+
.RE
|
11
|
+
.SH Examples
|
12
|
+
.PP
|
13
|
+
.RS
|
14
|
+
.nf
|
15
|
+
concat(:name)
|
16
|
+
.fi
|
17
|
+
.RE
|
18
|
+
.PP
|
19
|
+
.RS
|
20
|
+
.nf
|
21
|
+
concat(:name, between: ', ')
|
22
|
+
.fi
|
23
|
+
.RE
|
24
|
+
.PP
|
25
|
+
.RS
|
26
|
+
.nf
|
27
|
+
concat(between: ', '){|t| t.name }
|
28
|
+
.fi
|
29
|
+
.RE
|
30
|
+
.PP
|
31
|
+
.RS
|
32
|
+
.nf
|
33
|
+
concat(->(t){ t.name.upcase }, between: ', ')
|
34
|
+
.fi
|
35
|
+
.RE
|
36
|
+
.SH Description
|
37
|
+
.PP
|
38
|
+
Concatenates string representations of input values.
|
39
|
+
.SH Implementation notes
|
40
|
+
.PP
|
41
|
+
This aggregate function can be applied to any data type, not only String
|
42
|
+
attributes. Ruby's \fB\fCto_s\fR will be used on values prior to concatenation.
|
43
|
+
.PP
|
44
|
+
The options are:
|
45
|
+
.RS
|
46
|
+
.IP \(bu 2
|
47
|
+
\fB\fCbefore\fR starts the resulting string (defaults to '')
|
48
|
+
.IP \(bu 2
|
49
|
+
\fB\fCafter\fR ends the resulting string (defaults to '')
|
50
|
+
.IP \(bu 2
|
51
|
+
\fB\fCbetween\fR is used between each value
|
52
|
+
.RE
|
53
|
+
.PP
|
54
|
+
As of current Alf version, the order in which the values are concatenated
|
55
|
+
is not guaranteed. So far, this function is thus non\-deterministic.
|
@@ -0,0 +1,26 @@
|
|
1
|
+
.TH Contradiction
|
2
|
+
.PP
|
3
|
+
FALSE
|
4
|
+
.SH Signature
|
5
|
+
.PP
|
6
|
+
.RS
|
7
|
+
.nf
|
8
|
+
contradiction() -> Predicate
|
9
|
+
.fi
|
10
|
+
.RE
|
11
|
+
.SH Examples
|
12
|
+
.PP
|
13
|
+
.RS
|
14
|
+
.nf
|
15
|
+
false
|
16
|
+
.fi
|
17
|
+
.RE
|
18
|
+
.PP
|
19
|
+
.RS
|
20
|
+
.nf
|
21
|
+
contradiction
|
22
|
+
.fi
|
23
|
+
.RE
|
24
|
+
.SH Description
|
25
|
+
.PP
|
26
|
+
This predicate always return false. It is equivalent to \fB\fC->(t){ false }\fR\&.
|
data/doc/man/count.man
ADDED