pg_rls 0.2.5 → 1.0.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/.rubocop.yml +55 -17
- data/.ruby-version +1 -0
- data/CHANGELOG.md +19 -2
- data/CODE_OF_CONDUCT.md +77 -29
- data/Guardfile +44 -0
- data/README.md +247 -83
- data/Rakefile +5 -12
- data/Steepfile +29 -0
- data/UPGRADE.md +106 -0
- data/app/models/pg_rls/admin.rb +24 -0
- data/app/models/pg_rls/current.rb +48 -0
- data/app/models/pg_rls/record.rb +13 -0
- data/app/models/pg_rls/tenant/searchable.rb +60 -0
- data/app/models/pg_rls/tenant/securable.rb +67 -0
- data/app/models/pg_rls/tenant/switchable.rb +40 -0
- data/app/models/pg_rls/tenant.rb +9 -0
- data/assets/logo.svg +8 -0
- data/docker-compose.yml +14 -0
- data/lib/generators/pg_rls/active_record/active_record_generator.rb +62 -65
- data/lib/generators/pg_rls/install/install_generator.rb +38 -0
- data/lib/generators/pg_rls/pg_rls_generator.rb +2 -1
- data/lib/generators/pg_rls/templates/USAGE +28 -0
- data/lib/generators/pg_rls/templates/app/models/abstract_base_class.rb.tt +7 -0
- data/lib/generators/pg_rls/templates/app/models/model.rb.tt +22 -0
- data/lib/generators/pg_rls/templates/config/initializers/pg_rls.rb.tt +58 -0
- data/lib/generators/pg_rls/templates/db/migrate/backport_pg_rls_table.rb.tt +14 -0
- data/lib/generators/pg_rls/templates/db/migrate/convert_to_pg_rls_table.rb.tt +5 -0
- data/lib/generators/pg_rls/templates/db/migrate/convert_to_pg_rls_tenant_table.rb.tt +5 -0
- data/lib/generators/pg_rls/templates/db/migrate/create_pg_rls_table.rb.tt +29 -0
- data/lib/generators/pg_rls/templates/db/migrate/create_pg_rls_tenant_table.rb.tt +29 -0
- data/lib/pg_rls/active_record/connection_adapters/connection_pool.rb +31 -0
- data/lib/pg_rls/active_record/connection_adapters/postgre_sql/check_rls_user_privileges.rb +207 -0
- data/lib/pg_rls/active_record/connection_adapters/postgre_sql/errors.rb +17 -0
- data/lib/pg_rls/active_record/connection_adapters/postgre_sql/grant_rls_user_privileges.rb +167 -0
- data/lib/pg_rls/active_record/connection_adapters/postgre_sql/rls_functions.rb +91 -0
- data/lib/pg_rls/active_record/connection_adapters/postgre_sql/rls_policies.rb +56 -0
- data/lib/pg_rls/active_record/connection_adapters/postgre_sql/rls_triggers.rb +95 -0
- data/lib/pg_rls/active_record/connection_adapters/postgre_sql/rls_user_statements.rb +127 -0
- data/lib/pg_rls/active_record/connection_adapters/postgre_sql/schema_dumper.rb +71 -0
- data/lib/pg_rls/active_record/connection_adapters/postgre_sql/schema_statements.rb +120 -0
- data/lib/pg_rls/active_record/connection_adapters/postgre_sql/sql_helper_method.rb +30 -0
- data/lib/pg_rls/active_record/connection_adapters/postgre_sql.rb +36 -0
- data/lib/pg_rls/active_record/connection_adapters.rb +12 -0
- data/lib/pg_rls/active_record/database_shards.rb +74 -0
- data/lib/pg_rls/active_record/migration/command_recorder.rb +28 -0
- data/lib/pg_rls/active_record/migration.rb +11 -0
- data/lib/pg_rls/active_record/test_databases.rb +19 -0
- data/lib/pg_rls/active_record.rb +11 -0
- data/lib/pg_rls/active_support/string_ext.rb +17 -0
- data/lib/pg_rls/active_support.rb +9 -0
- data/lib/pg_rls/connection_config.rb +61 -0
- data/lib/pg_rls/deprecation.rb +14 -0
- data/lib/pg_rls/engine.rb +8 -0
- data/lib/pg_rls/error.rb +10 -0
- data/lib/pg_rls/generators/.keep +0 -0
- data/lib/pg_rls/railtie.rb +1 -11
- data/lib/pg_rls/tasks/.keep +0 -0
- data/lib/pg_rls/version.rb +3 -1
- data/lib/pg_rls.rb +67 -151
- data/rbs_collection.lock.yaml +132 -0
- data/rbs_collection.yaml +127 -0
- data/review_code.sh +33 -0
- data/sig/generators/pg_rls/active_record/active_record_generator.rbs +43 -0
- data/sig/generators/pg_rls/install/install_generator.rbs +20 -0
- data/sig/generators/pg_rls/pg_rls_generator.rbs +9 -0
- data/sig/pg_rls/active_record/connection_adapters/postgre_sql/check_rls_user_privileges.rbs +53 -0
- data/sig/pg_rls/active_record/connection_adapters/postgre_sql/errors.rbs +24 -0
- data/sig/pg_rls/active_record/connection_adapters/postgre_sql/grant_rls_user_privileges.rbs +55 -0
- data/sig/pg_rls/active_record/connection_adapters/postgre_sql/rls_functions.rbs +31 -0
- data/sig/pg_rls/active_record/connection_adapters/postgre_sql/rls_policies.rbs +28 -0
- data/sig/pg_rls/active_record/connection_adapters/postgre_sql/rls_triggers.rbs +35 -0
- data/sig/pg_rls/active_record/connection_adapters/postgre_sql/rls_user_statements.rbs +48 -0
- data/sig/pg_rls/active_record/connection_adapters/postgre_sql/schema_dumper.rbs +38 -0
- data/sig/pg_rls/active_record/connection_adapters/postgre_sql/schema_statements.rbs +67 -0
- data/sig/pg_rls/active_record/connection_adapters/postgre_sql/sql_helper_method.rbs +21 -0
- data/sig/pg_rls/active_record/connection_adapters/postgresql.rbs +10 -0
- data/sig/pg_rls/active_record/connection_adapters.rbs +50 -0
- data/sig/pg_rls/active_record/database_shards.rbs +34 -0
- data/sig/pg_rls/active_record/migration/command_recorder.rbs +14 -0
- data/sig/pg_rls/active_record/migration.rbs +8 -0
- data/sig/pg_rls/active_record.rbs +7 -0
- data/sig/pg_rls/active_support/hash_ext.rbs +11 -0
- data/sig/pg_rls/active_support/string_ext.rbs +27 -0
- data/sig/pg_rls/active_support.rbs +7 -0
- data/sig/pg_rls/app/models/pg_rls/record.rbs +4 -0
- data/sig/pg_rls/connection_config.rbs +16 -0
- data/sig/pg_rls/deprecation.rbs +9 -0
- data/sig/pg_rls/engine.rbs +7 -0
- data/sig/pg_rls/errors.rbs +14 -0
- data/sig/pg_rls/railtie.rbs +6 -0
- data/sig/pg_rls/tenant_test_helper.rbs +14 -0
- data/sig/pg_rls.rbs +60 -0
- data/sig/support/active_record.rbs +86 -0
- data/sig/support/active_support.rbs +7 -0
- data/sig/support/fowardable.rbs +2 -0
- data/sig/support/pg.rbs +12 -0
- data/sig/support/rails.rbs +38 -0
- data/start.sh +30 -0
- metadata +167 -12
- data/Gemfile +0 -21
- data/Gemfile.lock +0 -300
- data/bin/console +0 -15
- data/bin/setup +0 -8
data/sig/pg_rls.rbs
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PgRls
|
4
|
+
VERSION: String
|
5
|
+
DEFAULT_CONFIG_MAP: Hash[Symbol, (Symbol | Array[Symbol] | Array[untyped] | String)]
|
6
|
+
|
7
|
+
def self.setup: () { (untyped) -> untyped } -> untyped
|
8
|
+
|
9
|
+
def self.reset_config!: () -> void
|
10
|
+
|
11
|
+
def self.main_model: () -> untyped
|
12
|
+
|
13
|
+
def self.connection_config?: () -> bool
|
14
|
+
|
15
|
+
def self.freeze_config!: () -> void
|
16
|
+
|
17
|
+
def self.invalid_connection_config: () -> bot
|
18
|
+
|
19
|
+
@@search_methods: Array[Symbol]
|
20
|
+
def self.search_methods: () -> Array[Symbol]
|
21
|
+
def self.search_methods=: (Array[Symbol]) -> Array[Symbol]
|
22
|
+
|
23
|
+
@@table_name: String | Symbol
|
24
|
+
def self.table_name: () -> (String | Symbol)
|
25
|
+
def self.table_name=: (String | Symbol) -> (String | Symbol)
|
26
|
+
|
27
|
+
@@class_name: String | Symbol
|
28
|
+
def self.class_name: () -> (String | Symbol)
|
29
|
+
def self.class_name=: (String | Symbol) -> (String | Symbol)
|
30
|
+
|
31
|
+
@@username: String | Symbol
|
32
|
+
def self.username: () -> (String | Symbol)
|
33
|
+
def self.username=: (String | Symbol) -> (String | Symbol)
|
34
|
+
|
35
|
+
@@password: String | Symbol
|
36
|
+
def self.password: () -> (String | Symbol)
|
37
|
+
def self.password=: (String | Symbol) -> (String | Symbol)
|
38
|
+
|
39
|
+
@@schema: String | Symbol
|
40
|
+
def self.schema: () -> (String | Symbol)
|
41
|
+
def self.schema=: (String | Symbol) -> (String | Symbol)
|
42
|
+
|
43
|
+
@@rls_role_group: String | Symbol
|
44
|
+
def self.rls_role_group: () -> (String | Symbol)
|
45
|
+
def self.rls_role_group=: (String | Symbol) -> (String | Symbol)
|
46
|
+
|
47
|
+
@@connects_to: nil | Hash[Symbol, Hash[Symbol, Symbol]]
|
48
|
+
def self.connects_to: () -> (Hash[Symbol, Hash[Symbol, Symbol]] | nil)
|
49
|
+
def self.connects_to=: (Hash[Symbol, Hash[Symbol, Symbol]] | nil) -> (Hash[Symbol, Hash[Symbol, Symbol]] | nil)
|
50
|
+
|
51
|
+
@@current_attributes: Array[untyped]
|
52
|
+
def self.current_attributes: () -> Array[untyped]
|
53
|
+
def self.current_attributes=: (Array[untyped]) -> Array[untyped]
|
54
|
+
|
55
|
+
@@abstract_base_record_class: String | Symbol
|
56
|
+
def self.abstract_base_record_class: () -> (String | Symbol)
|
57
|
+
def self.abstract_base_record_class=: (String | Symbol) -> (String | Symbol)
|
58
|
+
|
59
|
+
def self.mattr_accessor: (Symbol) -> untyped
|
60
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
class StatementInvalid < StandardError
|
3
|
+
end
|
4
|
+
|
5
|
+
class Base
|
6
|
+
def self.ignored_columns=: (Array[(Symbol | String)]) -> Array[Symbol]
|
7
|
+
|
8
|
+
def self.ignored_columns: () -> Array[Symbol]
|
9
|
+
|
10
|
+
def self.connection: () -> ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
|
11
|
+
|
12
|
+
def self.transaction: (requires_new: bool?) { () -> untyped } -> untyped
|
13
|
+
|
14
|
+
def self.connection_db_config: () -> ActiveRecord::DatabaseConfigurations::HashConfig
|
15
|
+
end
|
16
|
+
|
17
|
+
class DatabaseConfigurations
|
18
|
+
class HashConfig
|
19
|
+
def configuration_hash: () -> Hash[Symbol, untyped]
|
20
|
+
|
21
|
+
def name: () -> String
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
module Migration
|
26
|
+
class CommandRecorder
|
27
|
+
def self.included: (Class) -> void
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
module Generators
|
32
|
+
class ModelGenerator < ::Rails::Generators::Base
|
33
|
+
def self.class_option: (Symbol, ?Hash[Symbol, untyped]) -> void
|
34
|
+
|
35
|
+
def check_class_collision: () -> void
|
36
|
+
|
37
|
+
@class_coalescing: bool
|
38
|
+
|
39
|
+
def destination_root: () -> String
|
40
|
+
|
41
|
+
def attributes: () -> Array[ActiveRecord::Generators::Attribute]
|
42
|
+
|
43
|
+
def options: () -> Hash[Symbol, untyped]
|
44
|
+
|
45
|
+
def database: () -> String
|
46
|
+
|
47
|
+
def file_name: () -> String
|
48
|
+
|
49
|
+
def class_path: () -> String
|
50
|
+
|
51
|
+
def migration_template: (String, ?String) -> void
|
52
|
+
|
53
|
+
def table_name: () -> String
|
54
|
+
|
55
|
+
def skip_migration_creation?: () -> bool
|
56
|
+
|
57
|
+
def custom_parent?: () -> bool
|
58
|
+
end
|
59
|
+
|
60
|
+
class Attribute
|
61
|
+
# a.attr_options.delete(:index) if a.reference? && !a.has_index?
|
62
|
+
def has_index?: () -> bool
|
63
|
+
|
64
|
+
def attr_options: () -> Hash[Symbol, untyped]
|
65
|
+
|
66
|
+
def reference?: () -> bool
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
module ConnectionAdapters
|
71
|
+
class AbstractAdapter
|
72
|
+
def rollback_db_transaction: () -> void
|
73
|
+
end
|
74
|
+
|
75
|
+
class PostgreSQLAdapter < AbstractAdapter
|
76
|
+
def execute: (String) -> untyped
|
77
|
+
end
|
78
|
+
module PostgreSQL
|
79
|
+
class SchemaStatements
|
80
|
+
end
|
81
|
+
|
82
|
+
class SchemaDumper
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
data/sig/support/pg.rbs
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
module PG
|
2
|
+
class Result
|
3
|
+
# Define methods that you are using from PG::Result, for example:
|
4
|
+
def each: () { (Hash[String, untyped]) -> void } -> void
|
5
|
+
def getvalue: (Integer, Integer) -> String
|
6
|
+
def ntuples: () -> Integer
|
7
|
+
def nfields: () -> Integer
|
8
|
+
def any?: () -> bool
|
9
|
+
def present?: () -> bool
|
10
|
+
# You can add more methods as needed
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Rails
|
4
|
+
def self.application: () -> untyped
|
5
|
+
|
6
|
+
def self.env: () -> untyped
|
7
|
+
|
8
|
+
class Engine
|
9
|
+
# Define isolate_namespace to accept a Module and return untyped
|
10
|
+
def self.isolate_namespace: (Module) -> untyped
|
11
|
+
end
|
12
|
+
|
13
|
+
class Railtie
|
14
|
+
end
|
15
|
+
|
16
|
+
module Generators
|
17
|
+
class Error < StandardError
|
18
|
+
end
|
19
|
+
|
20
|
+
class NamedBase
|
21
|
+
def self.hook_for: (Symbol, required: bool) -> void
|
22
|
+
end
|
23
|
+
|
24
|
+
class Base
|
25
|
+
def self.hook_for: (Symbol, required: bool) -> void
|
26
|
+
|
27
|
+
def self.source_root: (String) -> void
|
28
|
+
|
29
|
+
def behavior: -> Symbol
|
30
|
+
|
31
|
+
def readme: (String) -> void
|
32
|
+
|
33
|
+
def template: (String, ?String) -> void
|
34
|
+
|
35
|
+
def gsub_file: (String, Regexp, String) -> void
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/start.sh
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
set -x
|
5
|
+
|
6
|
+
if [[ $@ =~ (.*(clean)){1} ]]; then
|
7
|
+
docker stop $(docker ps -aq)
|
8
|
+
fi
|
9
|
+
|
10
|
+
docker_compose() {
|
11
|
+
if docker-compose version >/dev/null 2>&1; then
|
12
|
+
docker-compose $@
|
13
|
+
else
|
14
|
+
docker compose $@
|
15
|
+
fi
|
16
|
+
}
|
17
|
+
|
18
|
+
if [[ $@ =~ (.*(pull)){1} ]]; then
|
19
|
+
if [[ $@ =~ (.*(no-cache)){1} ]]; then
|
20
|
+
docker_compose pull --no-cache
|
21
|
+
else
|
22
|
+
docker_compose pull
|
23
|
+
fi
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [[ $@ =~ (.*(dev)){1} ]]; then
|
27
|
+
docker_compose up
|
28
|
+
else
|
29
|
+
docker_compose up -d
|
30
|
+
fi
|
metadata
CHANGED
@@ -1,15 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_rls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Laloush
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
11
|
+
date: 2025-06-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activerecord
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 7.2.2
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '9.0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 7.2.2
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '9.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: pg
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.2'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.2'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: railties
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '7.2'
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '9.0'
|
57
|
+
type: :runtime
|
58
|
+
prerelease: false
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '7.2'
|
64
|
+
- - "<"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '9.0'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: warden
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '1.2'
|
74
|
+
type: :runtime
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - "~>"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '1.2'
|
13
81
|
description: |2
|
14
82
|
This gem will help you to integrate PostgreSQL RLS to help you develop a great multitenancy application
|
15
83
|
checkout the repository at https://github.com/Dandush03/pg_rls
|
@@ -21,15 +89,24 @@ extra_rdoc_files: []
|
|
21
89
|
files:
|
22
90
|
- ".rspec"
|
23
91
|
- ".rubocop.yml"
|
92
|
+
- ".ruby-version"
|
24
93
|
- CHANGELOG.md
|
25
94
|
- CODE_OF_CONDUCT.md
|
26
|
-
-
|
27
|
-
- Gemfile.lock
|
95
|
+
- Guardfile
|
28
96
|
- LICENSE.txt
|
29
97
|
- README.md
|
30
98
|
- Rakefile
|
31
|
-
-
|
32
|
-
-
|
99
|
+
- Steepfile
|
100
|
+
- UPGRADE.md
|
101
|
+
- app/models/pg_rls/admin.rb
|
102
|
+
- app/models/pg_rls/current.rb
|
103
|
+
- app/models/pg_rls/record.rb
|
104
|
+
- app/models/pg_rls/tenant.rb
|
105
|
+
- app/models/pg_rls/tenant/searchable.rb
|
106
|
+
- app/models/pg_rls/tenant/securable.rb
|
107
|
+
- app/models/pg_rls/tenant/switchable.rb
|
108
|
+
- assets/logo.svg
|
109
|
+
- docker-compose.yml
|
33
110
|
- lib/generators/pg_rls.rb
|
34
111
|
- lib/generators/pg_rls/active_record/active_record_generator.rb
|
35
112
|
- lib/generators/pg_rls/active_record/templates/abstract_base_class.rb.tt
|
@@ -41,20 +118,55 @@ files:
|
|
41
118
|
- lib/generators/pg_rls/active_record/templates/migration.rb.tt
|
42
119
|
- lib/generators/pg_rls/active_record/templates/model.rb.tt
|
43
120
|
- lib/generators/pg_rls/base.rb
|
121
|
+
- lib/generators/pg_rls/install/install_generator.rb
|
44
122
|
- lib/generators/pg_rls/install_generator.rb
|
45
123
|
- lib/generators/pg_rls/pg_rls_generator.rb
|
124
|
+
- lib/generators/pg_rls/templates/USAGE
|
125
|
+
- lib/generators/pg_rls/templates/app/models/abstract_base_class.rb.tt
|
126
|
+
- lib/generators/pg_rls/templates/app/models/model.rb.tt
|
127
|
+
- lib/generators/pg_rls/templates/config/initializers/pg_rls.rb.tt
|
128
|
+
- lib/generators/pg_rls/templates/db/migrate/backport_pg_rls_table.rb.tt
|
129
|
+
- lib/generators/pg_rls/templates/db/migrate/convert_to_pg_rls_table.rb.tt
|
130
|
+
- lib/generators/pg_rls/templates/db/migrate/convert_to_pg_rls_tenant_table.rb.tt
|
131
|
+
- lib/generators/pg_rls/templates/db/migrate/create_pg_rls_table.rb.tt
|
132
|
+
- lib/generators/pg_rls/templates/db/migrate/create_pg_rls_tenant_table.rb.tt
|
46
133
|
- lib/generators/templates/README
|
47
134
|
- lib/generators/templates/pg_rls.rb.tt
|
48
135
|
- lib/pg_rls.rb
|
49
136
|
- lib/pg_rls/Rakefile
|
137
|
+
- lib/pg_rls/active_record.rb
|
138
|
+
- lib/pg_rls/active_record/connection_adapters.rb
|
139
|
+
- lib/pg_rls/active_record/connection_adapters/connection_pool.rb
|
140
|
+
- lib/pg_rls/active_record/connection_adapters/postgre_sql.rb
|
141
|
+
- lib/pg_rls/active_record/connection_adapters/postgre_sql/check_rls_user_privileges.rb
|
142
|
+
- lib/pg_rls/active_record/connection_adapters/postgre_sql/errors.rb
|
143
|
+
- lib/pg_rls/active_record/connection_adapters/postgre_sql/grant_rls_user_privileges.rb
|
144
|
+
- lib/pg_rls/active_record/connection_adapters/postgre_sql/rls_functions.rb
|
145
|
+
- lib/pg_rls/active_record/connection_adapters/postgre_sql/rls_policies.rb
|
146
|
+
- lib/pg_rls/active_record/connection_adapters/postgre_sql/rls_triggers.rb
|
147
|
+
- lib/pg_rls/active_record/connection_adapters/postgre_sql/rls_user_statements.rb
|
148
|
+
- lib/pg_rls/active_record/connection_adapters/postgre_sql/schema_dumper.rb
|
149
|
+
- lib/pg_rls/active_record/connection_adapters/postgre_sql/schema_statements.rb
|
150
|
+
- lib/pg_rls/active_record/connection_adapters/postgre_sql/sql_helper_method.rb
|
151
|
+
- lib/pg_rls/active_record/database_shards.rb
|
152
|
+
- lib/pg_rls/active_record/migration.rb
|
153
|
+
- lib/pg_rls/active_record/migration/command_recorder.rb
|
154
|
+
- lib/pg_rls/active_record/test_databases.rb
|
155
|
+
- lib/pg_rls/active_support.rb
|
156
|
+
- lib/pg_rls/active_support/string_ext.rb
|
157
|
+
- lib/pg_rls/connection_config.rb
|
50
158
|
- lib/pg_rls/current/context.rb
|
51
159
|
- lib/pg_rls/database/admin_statements.rb
|
52
160
|
- lib/pg_rls/database/configurations.rb
|
53
161
|
- lib/pg_rls/database/prepared.rb
|
54
162
|
- lib/pg_rls/database/tasks/admin_database.rake
|
163
|
+
- lib/pg_rls/deprecation.rb
|
164
|
+
- lib/pg_rls/engine.rb
|
165
|
+
- lib/pg_rls/error.rb
|
55
166
|
- lib/pg_rls/errors/index.rb
|
56
167
|
- lib/pg_rls/errors/rake_only_error.rb
|
57
168
|
- lib/pg_rls/errors/tenant_not_found.rb
|
169
|
+
- lib/pg_rls/generators/.keep
|
58
170
|
- lib/pg_rls/logger.rb
|
59
171
|
- lib/pg_rls/middleware.rb
|
60
172
|
- lib/pg_rls/middleware/set_reset_connection.rb
|
@@ -67,22 +179,65 @@ files:
|
|
67
179
|
- lib/pg_rls/schema/dumper.rb
|
68
180
|
- lib/pg_rls/schema/statements.rb
|
69
181
|
- lib/pg_rls/schema/up_statements.rb
|
182
|
+
- lib/pg_rls/tasks/.keep
|
70
183
|
- lib/pg_rls/tenant.rb
|
71
184
|
- lib/pg_rls/version.rb
|
185
|
+
- rbs_collection.lock.yaml
|
186
|
+
- rbs_collection.yaml
|
187
|
+
- review_code.sh
|
188
|
+
- sig/generators/pg_rls/active_record/active_record_generator.rbs
|
189
|
+
- sig/generators/pg_rls/install/install_generator.rbs
|
190
|
+
- sig/generators/pg_rls/pg_rls_generator.rbs
|
191
|
+
- sig/pg_rls.rbs
|
192
|
+
- sig/pg_rls/active_record.rbs
|
193
|
+
- sig/pg_rls/active_record/connection_adapters.rbs
|
194
|
+
- sig/pg_rls/active_record/connection_adapters/postgre_sql/check_rls_user_privileges.rbs
|
195
|
+
- sig/pg_rls/active_record/connection_adapters/postgre_sql/errors.rbs
|
196
|
+
- sig/pg_rls/active_record/connection_adapters/postgre_sql/grant_rls_user_privileges.rbs
|
197
|
+
- sig/pg_rls/active_record/connection_adapters/postgre_sql/rls_functions.rbs
|
198
|
+
- sig/pg_rls/active_record/connection_adapters/postgre_sql/rls_policies.rbs
|
199
|
+
- sig/pg_rls/active_record/connection_adapters/postgre_sql/rls_triggers.rbs
|
200
|
+
- sig/pg_rls/active_record/connection_adapters/postgre_sql/rls_user_statements.rbs
|
201
|
+
- sig/pg_rls/active_record/connection_adapters/postgre_sql/schema_dumper.rbs
|
202
|
+
- sig/pg_rls/active_record/connection_adapters/postgre_sql/schema_statements.rbs
|
203
|
+
- sig/pg_rls/active_record/connection_adapters/postgre_sql/sql_helper_method.rbs
|
204
|
+
- sig/pg_rls/active_record/connection_adapters/postgresql.rbs
|
205
|
+
- sig/pg_rls/active_record/database_shards.rbs
|
206
|
+
- sig/pg_rls/active_record/migration.rbs
|
207
|
+
- sig/pg_rls/active_record/migration/command_recorder.rbs
|
208
|
+
- sig/pg_rls/active_support.rbs
|
209
|
+
- sig/pg_rls/active_support/hash_ext.rbs
|
210
|
+
- sig/pg_rls/active_support/string_ext.rbs
|
211
|
+
- sig/pg_rls/app/models/pg_rls/record.rbs
|
212
|
+
- sig/pg_rls/connection_config.rbs
|
213
|
+
- sig/pg_rls/deprecation.rbs
|
214
|
+
- sig/pg_rls/engine.rbs
|
215
|
+
- sig/pg_rls/errors.rbs
|
216
|
+
- sig/pg_rls/railtie.rbs
|
217
|
+
- sig/pg_rls/tenant_test_helper.rbs
|
218
|
+
- sig/support/active_record.rbs
|
219
|
+
- sig/support/active_support.rbs
|
220
|
+
- sig/support/fowardable.rbs
|
221
|
+
- sig/support/pg.rbs
|
222
|
+
- sig/support/rails.rbs
|
223
|
+
- start.sh
|
72
224
|
homepage: https://github.com/Dandush03/pg_rls
|
73
225
|
licenses:
|
74
226
|
- MIT
|
75
227
|
metadata:
|
228
|
+
homepage_uri: https://github.com/Dandush03/pg_rls
|
229
|
+
source_code_uri: https://github.com/Dandush03/pg_rls
|
230
|
+
changelog_uri: https://github.com/Dandush03/pg_rls/releases
|
76
231
|
rubygems_mfa_required: 'true'
|
77
|
-
post_install_message:
|
232
|
+
post_install_message:
|
78
233
|
rdoc_options: []
|
79
234
|
require_paths:
|
80
235
|
- lib
|
81
236
|
required_ruby_version: !ruby/object:Gem::Requirement
|
82
237
|
requirements:
|
83
|
-
- - "
|
238
|
+
- - ">="
|
84
239
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
240
|
+
version: 3.0.0
|
86
241
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
242
|
requirements:
|
88
243
|
- - ">="
|
@@ -90,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
245
|
version: '0'
|
91
246
|
requirements: []
|
92
247
|
rubygems_version: 3.5.16
|
93
|
-
signing_key:
|
248
|
+
signing_key:
|
94
249
|
specification_version: 4
|
95
250
|
summary: Write a short summary, because RubyGems requires one.
|
96
251
|
test_files: []
|
data/Gemfile
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
# Specify your gem's dependencies in pg_rls.gemspec
|
6
|
-
gemspec
|
7
|
-
ruby '3.2.2'
|
8
|
-
|
9
|
-
gem 'rails', '~> 7.0', '>= 7.0.4'
|
10
|
-
|
11
|
-
gem 'rake'
|
12
|
-
|
13
|
-
gem 'rspec'
|
14
|
-
|
15
|
-
gem 'rubocop'
|
16
|
-
gem 'rubocop-performance'
|
17
|
-
gem 'rubocop-rails'
|
18
|
-
gem 'rubocop-rake'
|
19
|
-
gem 'rubocop-rspec'
|
20
|
-
gem 'sidekiq'
|
21
|
-
gem 'solargraph'
|