forked from tarantool/go-tarantool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.lua
60 lines (52 loc) · 1.42 KB
/
config.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
box.cfg{
listen = 3013,
wal_dir='xlog',
snap_dir='snap',
}
box.once("init", function()
local s = box.schema.space.create('test', {
id = 512,
if_not_exists = true,
})
s:create_index('primary', {type = 'tree', parts = {1, 'NUM'}, if_not_exists = true})
local st = box.schema.space.create('schematest', {
id = 514,
temporary = true,
if_not_exists = true,
field_count = 7,
format = {
[2] = {name = "name1"},
[3] = {type = "type2"},
[6] = {name = "name5", type = "str", more = "extra"},
},
})
st:create_index('primary', {
type = 'hash',
parts = {1, 'NUM'},
unique = true,
if_not_exists = true,
})
st:create_index('secondary', {
id = 3,
type = 'tree',
unique = false,
parts = { 2, 'num', 3, 'STR' },
if_not_exists = true,
})
st:truncate()
--box.schema.user.grant('guest', 'read,write,execute', 'universe')
box.schema.func.create('box.info')
box.schema.func.create('simple_incr')
-- auth testing: access control
box.schema.user.create('test', {password = 'test'})
box.schema.user.grant('test', 'execute', 'universe')
box.schema.user.grant('test', 'read,write', 'space', 'test')
box.schema.user.grant('test', 'read,write', 'space', 'schematest')
end)
function simple_incr(a)
return a+1
end
box.space.test:truncate()
local console = require 'console'
console.listen '0.0.0.0:33015'
--box.schema.user.revoke('guest', 'read,write,execute', 'universe')