standardapi 5.2.0.4 → 5.2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/standard_api/version.rb +1 -1
- data/lib/standard_api/views/application/schema.streamer +42 -23
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e091251cb3cfdcaaca2c8779fe6104dbd64e184004e98c8185574103c7fb4ebf
|
4
|
+
data.tar.gz: 7f256e0dc1c67018b147ad3b0b3784ed07edd8cea49f2c26d8f9958eb3c0e9db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d92f6d09f3559bde47d8d30750e60359c527e6bdbebafaf036971720dfca80be6315a4b64f0c17675bd7bc00b6de45cb59c9f57740e6c38ae269b437df1a226f
|
7
|
+
data.tar.gz: 04e267511914cbd3e3bb047ad8287fe43d10587b0e3b08a6579bcdca785dcd45336f9e7497c940ff7ff9b63efdeed8d7a0c6389dcd87b891ea7f55f718f6dae4
|
data/lib/standard_api/version.rb
CHANGED
@@ -1,32 +1,51 @@
|
|
1
|
-
mapping =
|
2
|
-
|
3
|
-
|
4
|
-
'
|
5
|
-
|
6
|
-
'
|
7
|
-
|
8
|
-
'
|
9
|
-
|
10
|
-
'
|
11
|
-
|
12
|
-
'
|
13
|
-
|
14
|
-
'
|
15
|
-
|
16
|
-
'
|
17
|
-
|
18
|
-
'
|
19
|
-
|
20
|
-
'
|
21
|
-
|
22
|
-
|
1
|
+
mapping = lambda do |sql_type|
|
2
|
+
case sql_type
|
3
|
+
when /character varying(\(\d+\))?/
|
4
|
+
'string'
|
5
|
+
when 'timestamp without time zone'
|
6
|
+
'datetime'
|
7
|
+
when 'time without time zone'
|
8
|
+
'datetime'
|
9
|
+
when 'text'
|
10
|
+
'string'
|
11
|
+
when 'json'
|
12
|
+
'hash'
|
13
|
+
when 'bigint'
|
14
|
+
'integer'
|
15
|
+
when 'integer'
|
16
|
+
'integer'
|
17
|
+
when 'jsonb'
|
18
|
+
'hash'
|
19
|
+
when 'inet'
|
20
|
+
'string' # TODO: should be inet
|
21
|
+
when 'hstore'
|
22
|
+
'hash'
|
23
|
+
when 'date'
|
24
|
+
'datetime'
|
25
|
+
when 'numeric(162)'
|
26
|
+
'decimal'
|
27
|
+
when 'numeric'
|
28
|
+
'decimal'
|
29
|
+
when 'double precision'
|
30
|
+
'decimal'
|
31
|
+
when 'ltree'
|
32
|
+
'string'
|
33
|
+
when 'boolean'
|
34
|
+
'boolean'
|
35
|
+
when 'geometry'
|
36
|
+
'ewkb'
|
37
|
+
when 'uuid' # TODO: should be uuid
|
38
|
+
'string'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
23
42
|
|
24
43
|
json.object! do
|
25
44
|
json.set! 'columns' do
|
26
45
|
json.object! do
|
27
46
|
model.columns.each do |column|
|
28
47
|
json.set! column.name, {
|
29
|
-
type: mapping
|
48
|
+
type: mapping.call(column.sql_type),
|
30
49
|
primary_key: column.name == model.primary_key,
|
31
50
|
null: column.null,
|
32
51
|
array: column.array
|