pg_eventstore 1.1.0 → 1.1.2
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/CHANGELOG.md +6 -0
- data/lib/pg_eventstore/version.rb +1 -1
- data/lib/pg_eventstore/web/application.rb +8 -5
- data/lib/pg_eventstore/web/paginator/event_types_collection.rb +3 -2
- data/lib/pg_eventstore/web/paginator/stream_contexts_collection.rb +2 -2
- data/lib/pg_eventstore/web/paginator/stream_names_collection.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edf4e7b2fb569adcc91434eecc16b269504108e980924f45543996b37f2fca67
|
4
|
+
data.tar.gz: 451796b0e92415aadf14c7ef6e2627378d99181f4a37104f8ce50ea990b12c75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78af9eb3c02e3f002765dfb888263a221e3f77cd005593ecff4c5a8443f781e992ecd30d0f81120f4afcd268b573afab5c8616f683aed0255104db7d1c6e3fa1
|
7
|
+
data.tar.gz: d8c27f5efd39737c453b490e176bba7cb6d24456faee0b86fb317899ec7bb19d411ed5fdc3f7ed7742a23deb36e87b70d2ce44a4727bf78e23709f77958bd1b9
|
data/CHANGELOG.md
CHANGED
@@ -9,8 +9,6 @@ module PgEventstore
|
|
9
9
|
set :environment, -> { (ENV['RACK_ENV'] || ENV['RAILS_ENV'] || ENV['APP_ENV'])&.to_sym || :development }
|
10
10
|
set :logging, -> { environment == :development || environment == :test }
|
11
11
|
set :erb, layout: :'layouts/application'
|
12
|
-
set :sessions, true
|
13
|
-
set :session_secret, ENV.fetch('SECRET_KEY_BASE') { SecureRandom.hex(64) }
|
14
12
|
|
15
13
|
helpers(Paginator::Helpers, Subscriptions::Helpers) do
|
16
14
|
# @return [Array<Hash>, nil]
|
@@ -29,7 +27,12 @@ module PgEventstore
|
|
29
27
|
|
30
28
|
# @return [Symbol]
|
31
29
|
def current_config
|
32
|
-
|
30
|
+
config = request.cookies['current_config']&.to_s&.to_sym
|
31
|
+
PgEventstore.available_configs.include?(config) ? config : :default
|
32
|
+
end
|
33
|
+
|
34
|
+
def current_config=(val)
|
35
|
+
response.set_cookie('current_config', { value: val.to_s, http_only: true, same_site: :lax })
|
33
36
|
end
|
34
37
|
|
35
38
|
# @return [PgEventstore::Connection]
|
@@ -96,8 +99,8 @@ module PgEventstore
|
|
96
99
|
post '/change_config' do
|
97
100
|
config = params[:config]&.to_sym
|
98
101
|
config = :default unless PgEventstore.available_configs.include?(config)
|
99
|
-
|
100
|
-
redirect(
|
102
|
+
self.current_config = config
|
103
|
+
redirect(redirect_back_url(fallback_url: '/'))
|
101
104
|
end
|
102
105
|
|
103
106
|
get '/stream_contexts_filtering', provides: :json do
|
@@ -15,7 +15,7 @@ module PgEventstore
|
|
15
15
|
where('context is not null and stream_name is not null').
|
16
16
|
group('event_type').order("event_type #{order}").limit(per_page)
|
17
17
|
sql_builder.where("event_type #{direction_operator} ?", starting_id) if starting_id
|
18
|
-
sql_builder.where('event_type
|
18
|
+
sql_builder.where('event_type ilike ?', "#{options[:query]}%")
|
19
19
|
connection.with do |conn|
|
20
20
|
conn.exec_params(*sql_builder.to_exec_params)
|
21
21
|
end.to_a
|
@@ -30,7 +30,8 @@ module PgEventstore
|
|
30
30
|
sql_builder =
|
31
31
|
SQLBuilder.new.select('event_type').from('partitions').
|
32
32
|
where('context is not null and stream_name is not null').
|
33
|
-
where("event_type #{direction_operator} ?", starting_id).
|
33
|
+
where("event_type #{direction_operator} ?", starting_id).
|
34
|
+
where('event_type ilike ?', "#{options[:query]}%").
|
34
35
|
group('event_type').order("event_type #{order}").limit(1).offset(per_page)
|
35
36
|
|
36
37
|
connection.with do |conn|
|
@@ -14,7 +14,7 @@ module PgEventstore
|
|
14
14
|
SQLBuilder.new.select('context').from('partitions').where('stream_name is null and event_type is null')
|
15
15
|
.limit(per_page).order("context #{order}")
|
16
16
|
sql_builder.where("context #{direction_operator} ?", starting_id) if starting_id
|
17
|
-
sql_builder.where('context
|
17
|
+
sql_builder.where('context ilike ?', "#{options[:query]}%")
|
18
18
|
connection.with do |conn|
|
19
19
|
conn.exec_params(*sql_builder.to_exec_params)
|
20
20
|
end.to_a
|
@@ -28,7 +28,7 @@ module PgEventstore
|
|
28
28
|
starting_id = collection.first['context']
|
29
29
|
sql_builder =
|
30
30
|
SQLBuilder.new.select('context').from('partitions').where('stream_name is null and event_type is null').
|
31
|
-
where("context #{direction_operator} ?", starting_id).where('context
|
31
|
+
where("context #{direction_operator} ?", starting_id).where('context ilike ?', "#{options[:query]}%").
|
32
32
|
limit(1).offset(per_page).order("context #{order}")
|
33
33
|
|
34
34
|
connection.with do |conn|
|
@@ -13,7 +13,7 @@ module PgEventstore
|
|
13
13
|
sql_builder =
|
14
14
|
SQLBuilder.new.select('stream_name').from('partitions').
|
15
15
|
where('event_type is null and context = ?', options[:context]).
|
16
|
-
where('stream_name
|
16
|
+
where('stream_name ilike ?', "#{options[:query]}%")
|
17
17
|
sql_builder.where("stream_name #{direction_operator} ?", starting_id) if starting_id
|
18
18
|
sql_builder.limit(per_page).order("stream_name #{order}")
|
19
19
|
connection.with do |conn|
|
@@ -30,7 +30,7 @@ module PgEventstore
|
|
30
30
|
sql_builder =
|
31
31
|
SQLBuilder.new.select('stream_name').from('partitions').
|
32
32
|
where("stream_name #{direction_operator} ?", starting_id).
|
33
|
-
where('stream_name
|
33
|
+
where('stream_name ilike ?', "#{options[:query]}%").
|
34
34
|
where('event_type is null and context = ?', options[:context]).
|
35
35
|
limit(1).offset(per_page).order("stream_name #{order}")
|
36
36
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_eventstore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Dzyzenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|