-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sql
More file actions
52 lines (44 loc) · 1.81 KB
/
init.sql
File metadata and controls
52 lines (44 loc) · 1.81 KB
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
-- init.sql
-- SQLite initialization script for FaaS platform
-- Routes table: key = "METHOD:URI", value = complete function config (JSON)
CREATE TABLE IF NOT EXISTS functions (
k TEXT PRIMARY KEY, -- Key: "METHOD:URI" (e.g., "POST:/resize")
v TEXT NOT NULL, -- Value: Complete JSON config
updated INTEGER DEFAULT (strftime('%s','now')) -- UNIX timestamp
);
CREATE INDEX IF NOT EXISTS idx_functions_updated ON functions(updated);
-- ===================================================================
-- Routes with complete function configuration
-- ===================================================================
INSERT OR REPLACE INTO functions (k, v, updated)
VALUES (
'POST:/resize',
'{"name":"resizeImage","runtime":"php","module":"examples/resize.php","handler":"main","memory":128,"timeout":10}',
strftime('%s','now')
);
INSERT OR REPLACE INTO functions (k, v, updated)
VALUES (
'GET:/ping',
'{"name":"ping","runtime":"php","module":"examples/ping.php","handler":"main","memory":64,"timeout":5}',
strftime('%s','now')
);
-- PHP function examples
INSERT OR REPLACE INTO functions (k, v, updated)
VALUES (
'POST:/api/hello',
'{"name":"helloPhp","runtime":"php","module":"examples/hello.php","handler":"main","memory":64,"timeout":5}',
strftime('%s','now')
);
INSERT OR REPLACE INTO functions (k, v, updated)
VALUES (
'GET:/api/info',
'{"name":"phpInfo","runtime":"php","module":"examples/info.php","handler":"main","memory":64,"timeout":5}',
strftime('%s','now')
);
-- Python WASM function
INSERT OR REPLACE INTO functions (k, v, updated)
VALUES (
'GET:/python',
'{"name":"app","runtime":"wasm","module":"/opt/functions/app/app.wasm","handler":"main","memory":128,"timeout":10}',
strftime('%s','now')
);