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/lib/alf/shell/from_argv.rb
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
module Alf
|
2
|
-
module Shell
|
3
|
-
|
4
|
-
FROM_ARGV = Myrrha.coercions do |c|
|
5
|
-
|
6
|
-
# ARGV -> Boolean
|
7
|
-
c.coercion(Array, Boolean){|argv,_|
|
8
|
-
throw :next_rule if argv.size > 1
|
9
|
-
Alf::Support.coerce(argv.first || false, Boolean)
|
10
|
-
}
|
11
|
-
|
12
|
-
# ARGV -> Size
|
13
|
-
c.coercion(Array, Size){|argv,_|
|
14
|
-
throw :next_rule if argv.size > 1
|
15
|
-
Size.new(Integer(argv.first || 0))
|
16
|
-
}
|
17
|
-
|
18
|
-
# ARGV -> Integer
|
19
|
-
c.coercion(Array, Integer){|argv,_|
|
20
|
-
throw :next_rule if argv.size > 1
|
21
|
-
Integer(argv.first || 0)
|
22
|
-
}
|
23
|
-
|
24
|
-
# ARGV -> AttrName
|
25
|
-
c.coercion(Array, AttrName){|argv,_|
|
26
|
-
throw :next_rule if argv.size > 1
|
27
|
-
AttrName.coerce(argv.first)
|
28
|
-
}
|
29
|
-
|
30
|
-
# ARGV -> AttrList
|
31
|
-
c.coercion(Array, AttrList){|argv,_|
|
32
|
-
AttrList.coerce(argv)
|
33
|
-
}
|
34
|
-
|
35
|
-
# ARGV -> Heading
|
36
|
-
c.coercion(Array, Heading){|argv,_|
|
37
|
-
Heading.coerce(argv)
|
38
|
-
}
|
39
|
-
|
40
|
-
# ARGV -> Ordering
|
41
|
-
c.coercion(Array, Ordering){|argv,_|
|
42
|
-
Ordering.coerce(argv)
|
43
|
-
}
|
44
|
-
|
45
|
-
# ARGV -> Renaming
|
46
|
-
c.coercion(Array, Renaming){|argv,_|
|
47
|
-
Renaming.coerce(argv)
|
48
|
-
}
|
49
|
-
|
50
|
-
# ARGV -> Summarization
|
51
|
-
c.coercion(Array, Summarization){|argv,_|
|
52
|
-
Summarization.coerce(argv)
|
53
|
-
}
|
54
|
-
|
55
|
-
# ARGV -> TupleComputation
|
56
|
-
c.coercion(Array, TupleComputation){|argv,_|
|
57
|
-
TupleComputation.coerce(argv)
|
58
|
-
}
|
59
|
-
|
60
|
-
# ARGV -> TupleExpression
|
61
|
-
c.coercion(Array, TupleExpression){|argv,_|
|
62
|
-
throw :next_rule if argv.size != 1
|
63
|
-
TupleExpression.coerce(argv.first)
|
64
|
-
}
|
65
|
-
|
66
|
-
# ARGV -> Predicate
|
67
|
-
c.coercion(Array, Predicate){|argv,_|
|
68
|
-
if argv.size == 1
|
69
|
-
Predicate.coerce(argv.first)
|
70
|
-
elsif (argv.size % 2) == 0
|
71
|
-
Predicate.coerce(Hash[argv.each_slice(2).map{|k,v| [k.to_sym, eval(v)] }])
|
72
|
-
else
|
73
|
-
throw :next_rule
|
74
|
-
end
|
75
|
-
}
|
76
|
-
|
77
|
-
end
|
78
|
-
|
79
|
-
def self.from_argv(argv, target_domain)
|
80
|
-
FROM_ARGV.coerce(argv, target_domain)
|
81
|
-
end
|
82
|
-
|
83
|
-
end # module Shell
|
84
|
-
end # module Alf
|
data/lib/alf/shell/operator.rb
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
require 'forwardable'
|
2
|
-
module Alf
|
3
|
-
module Shell
|
4
|
-
module Operator
|
5
|
-
|
6
|
-
module ClassMethods
|
7
|
-
extend Forwardable
|
8
|
-
|
9
|
-
attr_accessor :operator_class
|
10
|
-
def_delegators :operator_class, :signature,
|
11
|
-
:relational?,
|
12
|
-
:non_relational?,
|
13
|
-
:experimental?,
|
14
|
-
:nullary?,
|
15
|
-
:unary?,
|
16
|
-
:binary?
|
17
|
-
|
18
|
-
def command?
|
19
|
-
false
|
20
|
-
end
|
21
|
-
|
22
|
-
def operator?
|
23
|
-
true
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
module InstanceMethods
|
28
|
-
extend Forwardable
|
29
|
-
|
30
|
-
def_delegators :"self.class", :signature, :operator_class
|
31
|
-
|
32
|
-
def run(argv, req = nil)
|
33
|
-
@requester = req
|
34
|
-
compile(argv)
|
35
|
-
end
|
36
|
-
|
37
|
-
def compile(argv)
|
38
|
-
operands, args, options = signature.argv2args(argv)
|
39
|
-
operands = operands(operands, operator_class.arity)
|
40
|
-
init_args = [operands] + args + [options]
|
41
|
-
operator_class.new(*init_args)
|
42
|
-
end
|
43
|
-
|
44
|
-
end # module InstanceMethods
|
45
|
-
|
46
|
-
|
47
|
-
# Defines a command for `clazz`
|
48
|
-
def self.define_operator(op_name, op_class)
|
49
|
-
superclass = Shell::Operator() do |b|
|
50
|
-
b.callback do |cmd|
|
51
|
-
cmd.operator_class = op_class
|
52
|
-
end
|
53
|
-
end
|
54
|
-
Operator.const_set(::Alf::Support.class_name(op_class), Class.new(superclass))
|
55
|
-
end
|
56
|
-
|
57
|
-
Algebra::Operator.listen do |op_name, op_class|
|
58
|
-
define_operator(op_name, op_class)
|
59
|
-
end
|
60
|
-
|
61
|
-
end # module Operator
|
62
|
-
end # module Shell
|
63
|
-
end # module Alf
|
@@ -1 +0,0 @@
|
|
1
|
-
alf -e "(restrict suppliers, lambda{ status > 10})"
|
@@ -1 +0,0 @@
|
|
1
|
-
alf --help
|
@@ -1,76 +0,0 @@
|
|
1
|
-
|
2
|
-
alf - Relational algebra at your fingertips
|
3
|
-
|
4
|
-
SYNOPSIS
|
5
|
-
|
6
|
-
alf [--version] [--help]
|
7
|
-
alf -e '(lispy command)'
|
8
|
-
alf [FILE.alf]
|
9
|
-
alf [alf opts] OPERATOR [operator opts] ARGS ...
|
10
|
-
alf help OPERATOR
|
11
|
-
|
12
|
-
OPTIONS
|
13
|
-
|
14
|
-
-e, --execute Execute one line of script (Lispy API)
|
15
|
-
--rash Render output as ruby hashes
|
16
|
-
--text Render output as a text table
|
17
|
-
--yaml Render output in YAML
|
18
|
-
--json Render output in JSON
|
19
|
-
--csv Render output in CSV
|
20
|
-
--examples Use the example database for database
|
21
|
-
--db=DB Set the database to use
|
22
|
-
--input-reader=READER Specify the kind of reader when reading on $stdin (rash,csv,json,ruby)
|
23
|
-
-Idirectory Specify $LOAD_PATH directory (may be used more than once)
|
24
|
-
-rlibrary Require the library, before executing alf
|
25
|
-
--ff=FORMAT Specify the floating point format
|
26
|
-
--[no-]pretty Enable/disable pretty print best effort
|
27
|
-
-h, --help Show help
|
28
|
-
-v, --version Show version
|
29
|
-
|
30
|
-
RELATIONAL OPERATORS
|
31
|
-
|
32
|
-
extend Relational extension (additional, computed attributes)
|
33
|
-
frame Relational framing (aka offset/limit, yet sounder)
|
34
|
-
group Relational grouping (relation-valued attributes)
|
35
|
-
intersect Relational intersection (aka a logical and)
|
36
|
-
join Relational join (and cartesian product)
|
37
|
-
matching Relational matching (join + project back on left)
|
38
|
-
minus Relational minus (aka difference)
|
39
|
-
not-matching Relational not matching (inverse of matching)
|
40
|
-
page Relational pagination (like frame, but easier)
|
41
|
-
project Relational projection (clip + compact)
|
42
|
-
rank Relational ranking (explicit tuple positions)
|
43
|
-
rename Relational renaming (rename some attributes)
|
44
|
-
restrict Relational restriction (aka where, predicate filtering)
|
45
|
-
summarize Relational summarization (group-by + aggregate ops)
|
46
|
-
ungroup Relational un-grouping (inverse of group)
|
47
|
-
union Relational union
|
48
|
-
unwrap Relational un-wrapping (inverse of wrap)
|
49
|
-
wrap Relational wrapping (tuple-valued attributes)
|
50
|
-
|
51
|
-
EXPERIMENTAL RELATIONAL OPERATORS
|
52
|
-
|
53
|
-
hierarchize Relational hierarchy (recursive relation-trees)
|
54
|
-
infer-heading Relational heading inference (print the relation type)
|
55
|
-
quota Generalized quota-queries (position, sum progression, etc.)
|
56
|
-
|
57
|
-
NON-RELATIONAL OPERATORS
|
58
|
-
|
59
|
-
autonum Extend its operand with an unique autonumber attribute
|
60
|
-
clip Clip input tuples to a subset of attributes
|
61
|
-
coerce Force attribute coercion according to a heading
|
62
|
-
compact Remove tuple duplicates
|
63
|
-
defaults Force default values on missing/nil attributes
|
64
|
-
generator Generate a relation with an auto-numbered attribute
|
65
|
-
sort Sort input tuples according to an order relation
|
66
|
-
type-safe Check that input tuples are of a specified heading
|
67
|
-
|
68
|
-
OTHER NON-RELATIONAL COMMANDS
|
69
|
-
|
70
|
-
exec Executes an .alf file on current database
|
71
|
-
help Show help about a specific command
|
72
|
-
show Output input tuples through the default renderer in a specific order.
|
73
|
-
|
74
|
-
See 'alf help COMMAND' for details about a specific command.
|
75
|
-
|
76
|
-
SystemExit
|
@@ -1 +0,0 @@
|
|
1
|
-
alf -ruri extend suppliers -- uri "URI::parse(name).to_s"
|
@@ -1,5 +0,0 @@
|
|
1
|
-
{:sid => "S1", :name => "Smith", :status => 20, :city => "London", :uri => "Smith"}
|
2
|
-
{:sid => "S2", :name => "Jones", :status => 10, :city => "Paris", :uri => "Jones"}
|
3
|
-
{:sid => "S3", :name => "Blake", :status => 30, :city => "Paris", :uri => "Blake"}
|
4
|
-
{:sid => "S4", :name => "Clark", :status => 20, :city => "London", :uri => "Clark"}
|
5
|
-
{:sid => "S5", :name => "Adams", :status => 30, :city => "Athens", :uri => "Adams"}
|
@@ -1 +0,0 @@
|
|
1
|
-
alf --text autonum suppliers
|
@@ -1,9 +0,0 @@
|
|
1
|
-
+------+-------+---------+--------+----------+
|
2
|
-
| :sid | :name | :status | :city | :autonum |
|
3
|
-
+------+-------+---------+--------+----------+
|
4
|
-
| S1 | Smith | 20 | London | 0 |
|
5
|
-
| S2 | Jones | 10 | Paris | 1 |
|
6
|
-
| S3 | Blake | 30 | Paris | 2 |
|
7
|
-
| S4 | Clark | 20 | London | 3 |
|
8
|
-
| S5 | Adams | 30 | Athens | 4 |
|
9
|
-
+------+-------+---------+--------+----------+
|
@@ -1 +0,0 @@
|
|
1
|
-
alf --text autonum suppliers -- unique_id
|
@@ -1,9 +0,0 @@
|
|
1
|
-
+------+-------+---------+--------+------------+
|
2
|
-
| :sid | :name | :status | :city | :unique_id |
|
3
|
-
+------+-------+---------+--------+------------+
|
4
|
-
| S1 | Smith | 20 | London | 0 |
|
5
|
-
| S2 | Jones | 10 | Paris | 1 |
|
6
|
-
| S3 | Blake | 30 | Paris | 2 |
|
7
|
-
| S4 | Clark | 20 | London | 3 |
|
8
|
-
| S5 | Adams | 30 | Athens | 4 |
|
9
|
-
+------+-------+---------+--------+------------+
|
@@ -1 +0,0 @@
|
|
1
|
-
alf --text clip suppliers -- name city
|
@@ -1 +0,0 @@
|
|
1
|
-
alf --text clip suppliers --allbut -- name city
|
@@ -1 +0,0 @@
|
|
1
|
-
alf coerce suppliers -- sid Symbol status Integer
|
@@ -1,5 +0,0 @@
|
|
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"}
|
@@ -1 +0,0 @@
|
|
1
|
-
alf --text compact suppliers
|
@@ -1,9 +0,0 @@
|
|
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
|
-
+------+-------+---------+--------+
|
@@ -1 +0,0 @@
|
|
1
|
-
alf --text defaults suppliers -- country "'Belgium'"
|
@@ -1,9 +0,0 @@
|
|
1
|
-
+------+-------+---------+--------+----------+
|
2
|
-
| :sid | :name | :status | :city | :country |
|
3
|
-
+------+-------+---------+--------+----------+
|
4
|
-
| S1 | Smith | 20 | London | Belgium |
|
5
|
-
| S2 | Jones | 10 | Paris | Belgium |
|
6
|
-
| S3 | Blake | 30 | Paris | Belgium |
|
7
|
-
| S4 | Clark | 20 | London | Belgium |
|
8
|
-
| S5 | Adams | 30 | Athens | Belgium |
|
9
|
-
+------+-------+---------+--------+----------+
|
@@ -1 +0,0 @@
|
|
1
|
-
alf --text defaults --strict suppliers -- country "'Belgium'"
|
@@ -1 +0,0 @@
|
|
1
|
-
alf --text defaults suppliers -- country "city"
|
@@ -1,9 +0,0 @@
|
|
1
|
-
+------+-------+---------+--------+----------+
|
2
|
-
| :sid | :name | :status | :city | :country |
|
3
|
-
+------+-------+---------+--------+----------+
|
4
|
-
| S1 | Smith | 20 | London | London |
|
5
|
-
| S2 | Jones | 10 | Paris | Paris |
|
6
|
-
| S3 | Blake | 30 | Paris | Paris |
|
7
|
-
| S4 | Clark | 20 | London | London |
|
8
|
-
| S5 | Adams | 30 | Athens | Athens |
|
9
|
-
+------+-------+---------+--------+----------+
|
@@ -1 +0,0 @@
|
|
1
|
-
alf --text extend supplies -- sp "sid + '/' + pid" big "qty > 100 ? true : false"
|
@@ -1,16 +0,0 @@
|
|
1
|
-
+------+------+------+-------+-------+
|
2
|
-
| :sid | :pid | :qty | :sp | :big |
|
3
|
-
+------+------+------+-------+-------+
|
4
|
-
| S1 | P1 | 300 | S1/P1 | true |
|
5
|
-
| S1 | P2 | 200 | S1/P2 | true |
|
6
|
-
| S1 | P3 | 400 | S1/P3 | true |
|
7
|
-
| S1 | P4 | 200 | S1/P4 | true |
|
8
|
-
| S1 | P5 | 100 | S1/P5 | false |
|
9
|
-
| S1 | P6 | 100 | S1/P6 | false |
|
10
|
-
| S2 | P1 | 300 | S2/P1 | true |
|
11
|
-
| S2 | P2 | 400 | S2/P2 | true |
|
12
|
-
| S3 | P2 | 200 | S3/P2 | true |
|
13
|
-
| S4 | P2 | 200 | S4/P2 | true |
|
14
|
-
| S4 | P4 | 300 | S4/P4 | true |
|
15
|
-
| S4 | P5 | 400 | S4/P5 | true |
|
16
|
-
+------+------+------+-------+-------+
|
@@ -1 +0,0 @@
|
|
1
|
-
alf --text frame suppliers -- name -- 1 -- 2
|
@@ -1 +0,0 @@
|
|
1
|
-
alf generator
|
@@ -1 +0,0 @@
|
|
1
|
-
alf generator -- 5
|
@@ -1 +0,0 @@
|
|
1
|
-
alf generator -- 5 -- id
|
@@ -1 +0,0 @@
|
|
1
|
-
alf --text group supplies -- pid qty -- supplying
|
@@ -1 +0,0 @@
|
|
1
|
-
alf --text group --allbut supplies -- sid -- supplying
|