pgsqlarbiter 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pgsqlarbiter/analysis.rb +20 -3
- data/lib/pgsqlarbiter/analyzer.rb +1009 -356
- data/lib/pgsqlarbiter/arbiter.rb +81 -14
- data/lib/pgsqlarbiter/default_query_functions.rb +11 -3
- data/lib/pgsqlarbiter/default_query_types.rb +55 -0
- data/lib/pgsqlarbiter/error.rb +5 -0
- data/lib/pgsqlarbiter/keywords.rb +525 -58
- data/lib/pgsqlarbiter/lexer.rb +303 -216
- data/lib/pgsqlarbiter/parser.rb +55275 -0
- data/lib/pgsqlarbiter/schema.rb +235 -0
- data/lib/pgsqlarbiter/token.rb +14 -23
- data/lib/pgsqlarbiter/verdict.rb +32 -4
- data/lib/pgsqlarbiter/version.rb +1 -1
- data/lib/pgsqlarbiter.rb +34 -11
- metadata +19 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9bbf0665b15375975254f3e601113d79abcecf0481c80c6fe870cd0c4fcb00ef
|
|
4
|
+
data.tar.gz: 38f20704e047b8d64f14ef7baaf4999f8082d3fe1eaee60068f707191c732108
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97298aef34615114978a35c5d153f8825cb183d85e7f7206b271e2725401ad7dfaa3abf3bd39328a237b2c8b8297e1989b0f3df953632779efae17ca5c7ad527
|
|
7
|
+
data.tar.gz: 135f98871e8ecac8c13c98287cc33d232c173d9caeefae82839c982a2ab0044aa7146bd90a86d515cf4da999930b8668a206067636d8531bd9c8e5199dd01094
|
|
@@ -4,11 +4,28 @@ module Pgsqlarbiter
|
|
|
4
4
|
# Immutable result of analyzing a SQL query.
|
|
5
5
|
#
|
|
6
6
|
# @!attribute [r] statement_type
|
|
7
|
-
# @return [Symbol] the statement
|
|
8
|
-
# +:delete+, +:merge+, or +:values+)
|
|
7
|
+
# @return [Symbol] the type of the statement itself (+:select+, +:insert+,
|
|
8
|
+
# +:update+, +:delete+, +:merge+, or +:values+)
|
|
9
|
+
# @!attribute [r] statement_types
|
|
10
|
+
# @return [Array<Symbol>] sorted list of every statement type the query
|
|
11
|
+
# needs permission for: {#statement_type}, the type of each
|
|
12
|
+
# data-modifying statement inside a +WITH+ clause, and +:update+ when the
|
|
13
|
+
# query takes row locks (+FOR UPDATE+, +FOR SHARE+) or uses
|
|
14
|
+
# +ON CONFLICT DO UPDATE+
|
|
9
15
|
# @!attribute [r] tables
|
|
10
16
|
# @return [Array<String>] sorted list of referenced table and view names
|
|
17
|
+
# @!attribute [r] columns
|
|
18
|
+
# @return [Array<String>] sorted list of the table columns the query reads
|
|
19
|
+
# or writes, as +table.column+ with the table named as in {#tables}.
|
|
20
|
+
# +table.*+ stands for every column of the table: it is listed for +*+,
|
|
21
|
+
# for a whole-row reference such as +row_to_json(u)+, for +NATURAL JOIN+,
|
|
22
|
+
# for +INSERT+ without a column list, and for a table whose columns are
|
|
23
|
+
# renamed by a column alias list. Columns of tables that are missing
|
|
24
|
+
# from the {Schema} are not reliable; {Arbiter} denies such tables
|
|
11
25
|
# @!attribute [r] functions
|
|
12
26
|
# @return [Array<String>] sorted list of called function names
|
|
13
|
-
|
|
27
|
+
# @!attribute [r] types
|
|
28
|
+
# @return [Array<String>] sorted list of type names used in casts, typed
|
|
29
|
+
# literals and column definition lists
|
|
30
|
+
Analysis = Data.define(:statement_type, :statement_types, :tables, :columns, :functions, :types)
|
|
14
31
|
end
|