mat_views 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/README.md +4 -4
- data/app/assets/images/mat_views/android-chrome-192x192.png +0 -0
- data/app/assets/images/mat_views/android-chrome-512x512.png +0 -0
- data/app/assets/images/mat_views/apple-touch-icon.png +0 -0
- data/app/assets/images/mat_views/favicon-16x16.png +0 -0
- data/app/assets/images/mat_views/favicon-32x32.png +0 -0
- data/app/assets/images/mat_views/favicon-48x48.png +0 -0
- data/app/assets/images/mat_views/favicon.ico +0 -0
- data/app/assets/images/mat_views/favicon.svg +18 -0
- data/app/assets/images/mat_views/logo.svg +18 -0
- data/app/assets/images/mat_views/mask-icon.svg +5 -0
- data/app/assets/stylesheets/mat_views/application.css +323 -12
- data/app/controllers/mat_views/admin/application_controller.rb +135 -0
- data/app/controllers/mat_views/admin/dashboard_controller.rb +32 -0
- data/app/controllers/mat_views/admin/mat_view_definitions_controller.rb +248 -0
- data/app/controllers/mat_views/admin/preferences_controller.rb +91 -0
- data/app/controllers/mat_views/admin/runs_controller.rb +74 -0
- data/app/helpers/mat_views/admin/ui_helper.rb +385 -0
- data/app/javascript/mat_views/application.js +8 -0
- data/app/javascript/mat_views/controllers/application.js +10 -0
- data/app/javascript/mat_views/controllers/details_controller.js +122 -0
- data/app/javascript/mat_views/controllers/drawer_controller.js +252 -0
- data/app/javascript/mat_views/controllers/filter_controller.js +90 -0
- data/app/javascript/mat_views/controllers/flash_controller.js +13 -0
- data/app/javascript/mat_views/controllers/index.js +10 -0
- data/app/javascript/mat_views/controllers/mv_confirm_controller.js +281 -0
- data/app/javascript/mat_views/controllers/submitter_controller.js +15 -0
- data/app/javascript/mat_views/controllers/tabs_controller.js +67 -0
- data/app/javascript/mat_views/controllers/timezone_controller.js +16 -0
- data/app/javascript/mat_views/controllers/tooltip_controller.js +328 -0
- data/app/javascript/mat_views/controllers/turbo_frame_lifecycle_controller.js +49 -0
- data/app/jobs/mat_views/application_job.rb +2 -2
- data/app/jobs/mat_views/create_view_job.rb +9 -8
- data/app/jobs/mat_views/delete_view_job.rb +8 -8
- data/app/jobs/mat_views/refresh_view_job.rb +8 -9
- data/app/models/concerns/mat_views_i18n.rb +139 -0
- data/app/models/mat_views/application_record.rb +1 -0
- data/app/models/mat_views/mat_view_definition.rb +12 -7
- data/app/models/mat_views/mat_view_run.rb +11 -13
- data/app/views/layouts/mat_views/_footer.html.erb +41 -0
- data/app/views/layouts/mat_views/_header.html.erb +25 -0
- data/app/views/layouts/mat_views/admin.html.erb +47 -0
- data/app/views/layouts/mat_views/turbo_frame.html.erb +3 -0
- data/app/views/mat_views/admin/dashboard/index.html.erb +33 -0
- data/app/views/mat_views/admin/mat_view_definitions/_definition_actions.html.erb +94 -0
- data/app/views/mat_views/admin/mat_view_definitions/_table.html.erb +48 -0
- data/app/views/mat_views/admin/mat_view_definitions/empty.html.erb +1 -0
- data/app/views/mat_views/admin/mat_view_definitions/form.html.erb +79 -0
- data/app/views/mat_views/admin/mat_view_definitions/index.html.erb +10 -0
- data/app/views/mat_views/admin/mat_view_definitions/show.html.erb +40 -0
- data/app/views/mat_views/admin/preferences/show.html.erb +50 -0
- data/app/views/mat_views/admin/runs/_table.html.erb +61 -0
- data/app/views/mat_views/admin/runs/index.html.erb +38 -0
- data/app/views/mat_views/admin/runs/show.html.erb +64 -0
- data/app/views/mat_views/admin/ui/_card.html.erb +15 -0
- data/app/views/mat_views/admin/ui/_details.html.erb +10 -0
- data/app/views/mat_views/admin/ui/_flash.html.erb +6 -0
- data/app/views/mat_views/admin/ui/_table.html.erb +8 -0
- data/config/importmap.rb +9 -0
- data/config/locales/en-AU-ocker.yml +187 -0
- data/config/locales/en-AU.yml +187 -0
- data/config/locales/en-BB.yml +187 -0
- data/config/locales/en-BD.yml +187 -0
- data/config/locales/en-BE.yml +187 -0
- data/config/locales/en-BORK.yml +187 -0
- data/config/locales/en-BS.yml +187 -0
- data/config/locales/en-BZ.yml +187 -0
- data/config/locales/en-CA.yml +187 -0
- data/config/locales/en-CM.yml +187 -0
- data/config/locales/en-CY.yml +187 -0
- data/config/locales/en-EG.yml +187 -0
- data/config/locales/en-FJ.yml +187 -0
- data/config/locales/en-GB.yml +187 -0
- data/config/locales/en-GH.yml +187 -0
- data/config/locales/en-GI.yml +187 -0
- data/config/locales/en-GM.yml +187 -0
- data/config/locales/en-GY.yml +187 -0
- data/config/locales/en-HK.yml +187 -0
- data/config/locales/en-IE.yml +187 -0
- data/config/locales/en-IN.yml +187 -0
- data/config/locales/en-JM.yml +187 -0
- data/config/locales/en-KE.yml +187 -0
- data/config/locales/en-LK.yml +187 -0
- data/config/locales/en-LOL.yml +187 -0
- data/config/locales/en-LR.yml +187 -0
- data/config/locales/en-MS.yml +187 -0
- data/config/locales/en-MT.yml +187 -0
- data/config/locales/en-MW.yml +187 -0
- data/config/locales/en-MY.yml +187 -0
- data/config/locales/en-NG.yml +187 -0
- data/config/locales/en-NP.yml +187 -0
- data/config/locales/en-NZ.yml +187 -0
- data/config/locales/en-PG.yml +187 -0
- data/config/locales/en-PH.yml +187 -0
- data/config/locales/en-PK.yml +187 -0
- data/config/locales/en-RW.yml +187 -0
- data/config/locales/en-SCOT.yml +187 -0
- data/config/locales/en-SG.yml +187 -0
- data/config/locales/en-SHAKESPEARE.yml +187 -0
- data/config/locales/en-SL.yml +187 -0
- data/config/locales/en-SS.yml +187 -0
- data/config/locales/en-TH.yml +187 -0
- data/config/locales/en-TT.yml +187 -0
- data/config/locales/en-TZ.yml +187 -0
- data/config/locales/en-UG.yml +187 -0
- data/config/locales/en-US-pirate.yml +187 -0
- data/config/locales/en-US.yml +187 -0
- data/config/locales/en-YODA.yml +187 -0
- data/config/locales/en-ZA.yml +187 -0
- data/config/locales/en-ZW.yml +187 -0
- data/config/locales/en.yml +187 -0
- data/config/routes.rb +27 -3
- data/lib/generators/mat_views/install/templates/create_mat_view_definitions.rb +7 -7
- data/lib/generators/mat_views/install/templates/create_mat_view_runs.rb +5 -5
- data/lib/mat_views/admin/auth_bridge.rb +93 -0
- data/lib/mat_views/admin/default_auth.rb +61 -0
- data/lib/mat_views/configuration.rb +9 -0
- data/lib/mat_views/engine.rb +50 -2
- data/lib/mat_views/helpers/ui_test_ids.rb +43 -0
- data/lib/mat_views/services/base_service.rb +46 -38
- data/lib/mat_views/services/check_matview_exists.rb +76 -0
- data/lib/mat_views/services/concurrent_refresh.rb +9 -6
- data/lib/mat_views/services/create_view.rb +15 -15
- data/lib/mat_views/services/delete_view.rb +8 -11
- data/lib/mat_views/services/regular_refresh.rb +6 -5
- data/lib/mat_views/services/swap_refresh.rb +11 -9
- data/lib/mat_views/version.rb +1 -1
- data/lib/mat_views.rb +10 -4
- data/lib/tasks/helpers.rb +13 -13
- data/lib/tasks/mat_views_tasks.rake +15 -15
- metadata +130 -5
@@ -0,0 +1,187 @@
|
|
1
|
+
en-ZA:
|
2
|
+
activerecord:
|
3
|
+
attributes:
|
4
|
+
mat_views/mat_view_definition:
|
5
|
+
created_at: "Created at"
|
6
|
+
dependencies: "Dependencies"
|
7
|
+
name: "Name"
|
8
|
+
refresh_strategy: "Refresh strategy"
|
9
|
+
schedule_cron: "Schedule (cron)"
|
10
|
+
sql: "SQL (SELECT ...)"
|
11
|
+
unique_index_columns: "Unique index columns"
|
12
|
+
updated_at: "Updated at"
|
13
|
+
mat_views/mat_view_run:
|
14
|
+
created_at: "Created at"
|
15
|
+
details: "Details"
|
16
|
+
duration_ms: "Duration (ms)"
|
17
|
+
error: "Error"
|
18
|
+
finished_at: "Finished at"
|
19
|
+
mat_view_definition: "Definition"
|
20
|
+
meta: "Metadata"
|
21
|
+
operation: "Operation"
|
22
|
+
row_count_after: "Row count after"
|
23
|
+
row_count_before: "Row count before"
|
24
|
+
rows_before_after: "Rows (before/after)"
|
25
|
+
started_at: "Started at"
|
26
|
+
status: "Status"
|
27
|
+
updated_at: "Updated at"
|
28
|
+
enums:
|
29
|
+
mat_views/mat_view_definition:
|
30
|
+
refresh_strategy:
|
31
|
+
concurrent: "Concurrent"
|
32
|
+
regular: "Regular"
|
33
|
+
swap: "Swap"
|
34
|
+
mat_views/mat_view_run:
|
35
|
+
operation:
|
36
|
+
create: "Create"
|
37
|
+
drop: "Drop"
|
38
|
+
refresh: "Refresh"
|
39
|
+
status:
|
40
|
+
failed: "Failed"
|
41
|
+
running: "Running"
|
42
|
+
success: "Successful"
|
43
|
+
errors:
|
44
|
+
models:
|
45
|
+
mat_views/mat_view_definition:
|
46
|
+
attributes:
|
47
|
+
name:
|
48
|
+
blank: "must be provided"
|
49
|
+
invalid: "is not a valid PostgreSQL identifier"
|
50
|
+
taken: "must be unique"
|
51
|
+
sql:
|
52
|
+
blank: "must be provided"
|
53
|
+
invalid: "must start with SELECT"
|
54
|
+
unique_index_columns:
|
55
|
+
at_least_one: "must have at least one column when using concurrent refresh strategy"
|
56
|
+
hints:
|
57
|
+
mat_views/mat_view_definition:
|
58
|
+
dependencies: "Comma-separated list of tables or views this materialised view depends on."
|
59
|
+
name: "Name of the materialised view in the database."
|
60
|
+
refresh_strategy: "Determines how the materialised view is refreshed."
|
61
|
+
schedule_cron: "Use standard cron format. Leave empty for no scheduling."
|
62
|
+
sql: "The SQL query must be a valid SELECT statement."
|
63
|
+
unique_index_columns: "Columns to create a unique index on. Required for concurrent refresh."
|
64
|
+
mat_views/mat_view_run:
|
65
|
+
error: "Error message if the run failed."
|
66
|
+
meta: "Additional metadata in JSON format."
|
67
|
+
operation: "Type of operation performed."
|
68
|
+
status: "Current status of the run."
|
69
|
+
models:
|
70
|
+
mat_views/mat_view_definition: "Materialised View Definition"
|
71
|
+
mat_views/mat_view_run: "Materialised View Run"
|
72
|
+
placeholders:
|
73
|
+
mat_views/mat_view_definition:
|
74
|
+
dependencies: "Enter dependencies (comma separated, optional)"
|
75
|
+
name: "Enter name"
|
76
|
+
refresh_strategy: "Select refresh strategy"
|
77
|
+
schedule_cron: "0 0 * * * for daily at midnight, leave empty for no scheduling"
|
78
|
+
sql: "Enter SQL (SELECT ...)"
|
79
|
+
unique_index_columns: "Enter unique index columns (comma separated, optional)"
|
80
|
+
mat_views/mat_view_run:
|
81
|
+
error: "Error message"
|
82
|
+
mat_view_definition: "Select materialised view"
|
83
|
+
meta: "Metadata (JSON)"
|
84
|
+
operation: "Select operation"
|
85
|
+
status: "Select status"
|
86
|
+
i18n:
|
87
|
+
name: English (South Africa)
|
88
|
+
mat_views:
|
89
|
+
actions: "Actions"
|
90
|
+
all_definitions: "All definitions"
|
91
|
+
all_operations: "All operations"
|
92
|
+
all_statuses: "All statuses"
|
93
|
+
cancel: "Cancel"
|
94
|
+
close: "Close"
|
95
|
+
close_window: "Close window"
|
96
|
+
create: "Create"
|
97
|
+
dashboard:
|
98
|
+
metrics:
|
99
|
+
title: "Metrics"
|
100
|
+
title: "Dashboard"
|
101
|
+
definition: "Definition"
|
102
|
+
definitions: "Definitions"
|
103
|
+
delete: "Delete"
|
104
|
+
details: "Details"
|
105
|
+
edit: "Edit"
|
106
|
+
edit_var: "Edit %{name}"
|
107
|
+
errors:
|
108
|
+
frame_only: "This action can only be performed in a frame, redirected to dashboard."
|
109
|
+
prevented_saving:
|
110
|
+
one: "1 error prevented saving:"
|
111
|
+
other: "%{count} errors prevented saving:"
|
112
|
+
filter_by: "Filter by:"
|
113
|
+
footer:
|
114
|
+
copyright: "© %{year} %{company} All rights reserved."
|
115
|
+
documentation: "Documentation"
|
116
|
+
need_help: "Need guaranteed uptime & expert help?"
|
117
|
+
open_issue: "Open an Issue"
|
118
|
+
project_homepage: "Project Homepage"
|
119
|
+
support: "Get Professional Support →"
|
120
|
+
tagline: "Built with ❤️ by developers, for developers."
|
121
|
+
tooltip:
|
122
|
+
documentation: "Read the documentation"
|
123
|
+
gem_version: "Click to visit the RubyGems page"
|
124
|
+
open_issue: "Report a bug or request a feature"
|
125
|
+
project_homepage: "GitHub repository"
|
126
|
+
support: "Professional support plans"
|
127
|
+
version: "v%{version}"
|
128
|
+
header:
|
129
|
+
signed_in_as: "Signed in as %{email}"
|
130
|
+
history: "History"
|
131
|
+
loading: "Loading..."
|
132
|
+
loading_definitions: "Loading definitions..."
|
133
|
+
loading_runs: "Loading runs..."
|
134
|
+
mat_view_definition:
|
135
|
+
create_mv: "Create MV"
|
136
|
+
create_mv_tooltip: "Creates the materialised view in the database."
|
137
|
+
delete_confirm: "Delete definition %{name}? (Does NOT drop MV)"
|
138
|
+
delete_tooltip: "Deletes the definition but does NOT drop the materialised view in the database."
|
139
|
+
drop_mv: "Drop MV"
|
140
|
+
drop_mv_cascade: "Drop MV (Cascade)"
|
141
|
+
drop_mv_cascade_confirm: "Drop materialised view and all dependent objects for %{name}?"
|
142
|
+
drop_mv_cascade_tooltip: "Drops the materialised view and all dependent objects in the database. Definition remains."
|
143
|
+
drop_mv_confirm: "Drop materialised view for %{name}?"
|
144
|
+
drop_mv_tooltip: "Drops the materialised view in the database. Definition remains."
|
145
|
+
edit_tooltip: "Edit materialised view definition."
|
146
|
+
materialized_view: "Materialised View"
|
147
|
+
materialized_view_exists: "Materialised view exists"
|
148
|
+
materialized_view_not_exists: "Materialised view not created yet!"
|
149
|
+
new_definition: "New definition"
|
150
|
+
new_definition_tooltip: "Create a new materialised view definition."
|
151
|
+
no_definitions: "No materialised view definitions found. Create one to get started."
|
152
|
+
refresh_tooltip: "Refreshes the materialised view in the database."
|
153
|
+
sql_summary_tooltip: "Click to expand/collapse SQL"
|
154
|
+
view_tooltip: "View materialised view definition."
|
155
|
+
mat_view_run:
|
156
|
+
error_tooltip: "Error message if the run failed."
|
157
|
+
meta_tooltip: "Additional metadata in JSON format."
|
158
|
+
no_runs: "No runs found."
|
159
|
+
no_runs_if_filtered: "No runs found for the selected filters."
|
160
|
+
view_details: "View details"
|
161
|
+
view_tooltip: "View run details."
|
162
|
+
project_author: "Codevedas Inc."
|
163
|
+
project_description: "Admin interface for managing PostgreSQL materialised views in Rails applications."
|
164
|
+
project_tags: "rails, ruby, materialised views, admin, dashboard, ui, interface, management"
|
165
|
+
refresh: "Refresh"
|
166
|
+
refresh_contents: "Refresh contents"
|
167
|
+
reloading: "Reloading..."
|
168
|
+
reset: "Reset"
|
169
|
+
run: "Run"
|
170
|
+
runs: "Runs"
|
171
|
+
save_changes: "Save changes"
|
172
|
+
settings:
|
173
|
+
auto: "Auto"
|
174
|
+
dark: "Dark"
|
175
|
+
language: "Language"
|
176
|
+
language_hint: "Choose your interface language."
|
177
|
+
light: "Light"
|
178
|
+
theme: "Theme"
|
179
|
+
theme_hint: "Auto follows your system preference, light and dark overrides it."
|
180
|
+
title: "Preferences"
|
181
|
+
title: "MatViews Admin"
|
182
|
+
view_var: "View %{name}"
|
183
|
+
time:
|
184
|
+
am: "AM"
|
185
|
+
formats:
|
186
|
+
datetime12hour: "%Y-%m-%d %I:%M:%S %p"
|
187
|
+
pm: "PM"
|
@@ -0,0 +1,187 @@
|
|
1
|
+
en-ZW:
|
2
|
+
activerecord:
|
3
|
+
attributes:
|
4
|
+
mat_views/mat_view_definition:
|
5
|
+
created_at: "Created at"
|
6
|
+
dependencies: "Dependencies"
|
7
|
+
name: "Name"
|
8
|
+
refresh_strategy: "Refresh strategy"
|
9
|
+
schedule_cron: "Schedule (cron)"
|
10
|
+
sql: "SQL (SELECT ...)"
|
11
|
+
unique_index_columns: "Unique index columns"
|
12
|
+
updated_at: "Updated at"
|
13
|
+
mat_views/mat_view_run:
|
14
|
+
created_at: "Created at"
|
15
|
+
details: "Details"
|
16
|
+
duration_ms: "Duration (ms)"
|
17
|
+
error: "Error"
|
18
|
+
finished_at: "Finished at"
|
19
|
+
mat_view_definition: "Definition"
|
20
|
+
meta: "Metadata"
|
21
|
+
operation: "Operation"
|
22
|
+
row_count_after: "Row count after"
|
23
|
+
row_count_before: "Row count before"
|
24
|
+
rows_before_after: "Rows (before/after)"
|
25
|
+
started_at: "Started at"
|
26
|
+
status: "Status"
|
27
|
+
updated_at: "Updated at"
|
28
|
+
enums:
|
29
|
+
mat_views/mat_view_definition:
|
30
|
+
refresh_strategy:
|
31
|
+
concurrent: "Concurrent"
|
32
|
+
regular: "Regular"
|
33
|
+
swap: "Swap"
|
34
|
+
mat_views/mat_view_run:
|
35
|
+
operation:
|
36
|
+
create: "Create"
|
37
|
+
drop: "Drop"
|
38
|
+
refresh: "Refresh"
|
39
|
+
status:
|
40
|
+
failed: "Failed"
|
41
|
+
running: "Running"
|
42
|
+
success: "Successful"
|
43
|
+
errors:
|
44
|
+
models:
|
45
|
+
mat_views/mat_view_definition:
|
46
|
+
attributes:
|
47
|
+
name:
|
48
|
+
blank: "must be provided"
|
49
|
+
invalid: "is not a valid PostgreSQL identifier"
|
50
|
+
taken: "is already taken"
|
51
|
+
sql:
|
52
|
+
blank: "must be provided"
|
53
|
+
invalid: "must begin with SELECT"
|
54
|
+
unique_index_columns:
|
55
|
+
at_least_one: "must include at least one column when using concurrent refresh strategy"
|
56
|
+
hints:
|
57
|
+
mat_views/mat_view_definition:
|
58
|
+
dependencies: "Comma-separated list of tables or views this materialised view depends on."
|
59
|
+
name: "The name of the materialised view in the database."
|
60
|
+
refresh_strategy: "Specifies how the materialised view is refreshed."
|
61
|
+
schedule_cron: "Use the standard cron format. Leave empty for no scheduling."
|
62
|
+
sql: "The SQL query must be a valid SELECT statement."
|
63
|
+
unique_index_columns: "Columns to create a unique index on. Required for concurrent refresh."
|
64
|
+
mat_views/mat_view_run:
|
65
|
+
error: "Error message if the run failed."
|
66
|
+
meta: "Additional metadata in JSON format."
|
67
|
+
operation: "Type of operation performed."
|
68
|
+
status: "The current status of the run."
|
69
|
+
models:
|
70
|
+
mat_views/mat_view_definition: "Materialised View Definition"
|
71
|
+
mat_views/mat_view_run: "Materialised View Run"
|
72
|
+
placeholders:
|
73
|
+
mat_views/mat_view_definition:
|
74
|
+
dependencies: "Enter dependencies (comma separated, optional)"
|
75
|
+
name: "Enter name"
|
76
|
+
refresh_strategy: "Select refresh strategy"
|
77
|
+
schedule_cron: "0 0 * * * for daily at midnight, leave empty for no scheduling"
|
78
|
+
sql: "Enter SQL (SELECT ...)"
|
79
|
+
unique_index_columns: "Enter unique index columns (comma separated, optional)"
|
80
|
+
mat_views/mat_view_run:
|
81
|
+
error: "Enter error message"
|
82
|
+
mat_view_definition: "Select materialised view"
|
83
|
+
meta: "Enter metadata (JSON)"
|
84
|
+
operation: "Select operation"
|
85
|
+
status: "Select status"
|
86
|
+
i18n:
|
87
|
+
name: English (Zimbabwe)
|
88
|
+
mat_views:
|
89
|
+
actions: "Actions"
|
90
|
+
all_definitions: "All definitions"
|
91
|
+
all_operations: "All operations"
|
92
|
+
all_statuses: "All statuses"
|
93
|
+
cancel: "Cancel"
|
94
|
+
close: "Close"
|
95
|
+
close_window: "Close window"
|
96
|
+
create: "Create"
|
97
|
+
dashboard:
|
98
|
+
metrics:
|
99
|
+
title: "Metrics"
|
100
|
+
title: "Dashboard"
|
101
|
+
definition: "Definition"
|
102
|
+
definitions: "Definitions"
|
103
|
+
delete: "Delete"
|
104
|
+
details: "Details"
|
105
|
+
edit: "Edit"
|
106
|
+
edit_var: "Edit %{name}"
|
107
|
+
errors:
|
108
|
+
frame_only: "This action may only be performed within a frame. Redirected to dashboard."
|
109
|
+
prevented_saving:
|
110
|
+
one: "1 error prevented saving:"
|
111
|
+
other: "%{count} errors prevented saving:"
|
112
|
+
filter_by: "Filter by:"
|
113
|
+
footer:
|
114
|
+
copyright: "© %{year} %{company} All rights reserved."
|
115
|
+
documentation: "Documentation"
|
116
|
+
need_help: "Need guaranteed uptime and expert support?"
|
117
|
+
open_issue: "Open an Issue"
|
118
|
+
project_homepage: "Project Homepage"
|
119
|
+
support: "Professional Support →"
|
120
|
+
tagline: "Built with ❤️ by developers, for developers."
|
121
|
+
tooltip:
|
122
|
+
documentation: "Read the documentation"
|
123
|
+
gem_version: "Visit the RubyGems page"
|
124
|
+
open_issue: "Report a bug or request a feature"
|
125
|
+
project_homepage: "GitHub repository"
|
126
|
+
support: "Professional support plans"
|
127
|
+
version: "v%{version}"
|
128
|
+
header:
|
129
|
+
signed_in_as: "Signed in as %{email}"
|
130
|
+
history: "History"
|
131
|
+
loading: "Loading..."
|
132
|
+
loading_definitions: "Loading definitions..."
|
133
|
+
loading_runs: "Loading runs..."
|
134
|
+
mat_view_definition:
|
135
|
+
create_mv: "Create MV"
|
136
|
+
create_mv_tooltip: "Creates the materialised view in the database."
|
137
|
+
delete_confirm: "Delete definition %{name}? (This will not drop the MV)"
|
138
|
+
delete_tooltip: "Deletes the definition but does not drop the materialised view."
|
139
|
+
drop_mv: "Drop MV"
|
140
|
+
drop_mv_cascade: "Drop MV (Cascade)"
|
141
|
+
drop_mv_cascade_confirm: "Drop the materialised view and all dependent objects for %{name}?"
|
142
|
+
drop_mv_cascade_tooltip: "Drops the materialised view and all dependent objects. The definition remains."
|
143
|
+
drop_mv_confirm: "Drop materialised view for %{name}?"
|
144
|
+
drop_mv_tooltip: "Drops only the materialised view. The definition remains."
|
145
|
+
edit_tooltip: "Edit the materialised view definition."
|
146
|
+
materialized_view: "Materialised View"
|
147
|
+
materialized_view_exists: "Materialised view exists"
|
148
|
+
materialized_view_not_exists: "Materialised view not created yet"
|
149
|
+
new_definition: "New definition"
|
150
|
+
new_definition_tooltip: "Create a new materialised view definition."
|
151
|
+
no_definitions: "No materialised view definitions found. Create one to begin."
|
152
|
+
refresh_tooltip: "Refreshes the materialised view."
|
153
|
+
sql_summary_tooltip: "Click to expand or collapse SQL"
|
154
|
+
view_tooltip: "View materialised view definition."
|
155
|
+
mat_view_run:
|
156
|
+
error_tooltip: "Error message if the run failed."
|
157
|
+
meta_tooltip: "Additional metadata in JSON format."
|
158
|
+
no_runs: "No runs found."
|
159
|
+
no_runs_if_filtered: "No runs found for the selected filters."
|
160
|
+
view_details: "View details"
|
161
|
+
view_tooltip: "View run details"
|
162
|
+
project_author: "Codevedas Inc."
|
163
|
+
project_description: "Administrative interface for managing PostgreSQL materialised views in Rails applications."
|
164
|
+
project_tags: "rails, ruby, materialised views, admin, dashboard, ui, interface, management"
|
165
|
+
refresh: "Refresh"
|
166
|
+
refresh_contents: "Refresh contents"
|
167
|
+
reloading: "Reloading..."
|
168
|
+
reset: "Reset"
|
169
|
+
run: "Run"
|
170
|
+
runs: "Runs"
|
171
|
+
save_changes: "Save changes"
|
172
|
+
settings:
|
173
|
+
auto: "Auto"
|
174
|
+
dark: "Dark"
|
175
|
+
language: "Language"
|
176
|
+
language_hint: "Choose your interface language."
|
177
|
+
light: "Light"
|
178
|
+
theme: "Theme"
|
179
|
+
theme_hint: "Auto follows your system preference; light and dark override it."
|
180
|
+
title: "Preferences"
|
181
|
+
title: "MatViews Admin"
|
182
|
+
view_var: "View %{name}"
|
183
|
+
time:
|
184
|
+
am: "AM"
|
185
|
+
formats:
|
186
|
+
datetime12hour: "%Y-%m-%d %I:%M:%S %p"
|
187
|
+
pm: "PM"
|
@@ -0,0 +1,187 @@
|
|
1
|
+
en:
|
2
|
+
activerecord:
|
3
|
+
attributes:
|
4
|
+
mat_views/mat_view_definition:
|
5
|
+
created_at: "Created at"
|
6
|
+
dependencies: "Dependencies"
|
7
|
+
name: "Name"
|
8
|
+
refresh_strategy: "Refresh strategy"
|
9
|
+
schedule_cron: "Schedule (cron)"
|
10
|
+
sql: "SQL (SELECT ...)"
|
11
|
+
unique_index_columns: "Unique index columns"
|
12
|
+
updated_at: "Updated at"
|
13
|
+
mat_views/mat_view_run:
|
14
|
+
created_at: "Created at"
|
15
|
+
details: "Details"
|
16
|
+
duration_ms: "Duration (ms)"
|
17
|
+
error: "Error"
|
18
|
+
finished_at: "Finished at"
|
19
|
+
mat_view_definition: "Definition"
|
20
|
+
meta: "Metadata"
|
21
|
+
operation: "Operation"
|
22
|
+
row_count_after: "Row count after"
|
23
|
+
row_count_before: "Row count before"
|
24
|
+
rows_before_after: "Rows (before/after)"
|
25
|
+
started_at: "Started at"
|
26
|
+
status: "Status"
|
27
|
+
updated_at: "Updated at"
|
28
|
+
enums:
|
29
|
+
mat_views/mat_view_definition:
|
30
|
+
refresh_strategy:
|
31
|
+
concurrent: "Concurrent"
|
32
|
+
regular: "Regular"
|
33
|
+
swap: "Swap"
|
34
|
+
mat_views/mat_view_run:
|
35
|
+
operation:
|
36
|
+
create: "Create"
|
37
|
+
drop: "Drop"
|
38
|
+
refresh: "Refresh"
|
39
|
+
status:
|
40
|
+
failed: "Failed"
|
41
|
+
running: "Running"
|
42
|
+
success: "Success"
|
43
|
+
errors:
|
44
|
+
models:
|
45
|
+
mat_views/mat_view_definition:
|
46
|
+
attributes:
|
47
|
+
name:
|
48
|
+
blank: "must be provided"
|
49
|
+
invalid: "is not a valid PostgreSQL identifier"
|
50
|
+
taken: "must be unique"
|
51
|
+
sql:
|
52
|
+
blank: "must be provided"
|
53
|
+
invalid: "must start with SELECT"
|
54
|
+
unique_index_columns:
|
55
|
+
at_least_one: "must have at least one column when using concurrent refresh strategy"
|
56
|
+
hints:
|
57
|
+
mat_views/mat_view_definition:
|
58
|
+
dependencies: "Comma-separated list of tables or views this materialized view depends on."
|
59
|
+
name: "Name of the materialized view in the database."
|
60
|
+
refresh_strategy: "Determines how the materialized view is refreshed."
|
61
|
+
schedule_cron: "Use standard cron format. Leave empty for no scheduling."
|
62
|
+
sql: "The SQL query must be a valid SELECT statement."
|
63
|
+
unique_index_columns: "Columns to create a unique index on. Required for concurrent refresh."
|
64
|
+
mat_views/mat_view_run:
|
65
|
+
error: "Error message if the run failed."
|
66
|
+
meta: "Additional metadata in JSON format."
|
67
|
+
operation: "Type of operation performed."
|
68
|
+
status: "Current status of the run."
|
69
|
+
models:
|
70
|
+
mat_views/mat_view_definition: "Materialized View Definition"
|
71
|
+
mat_views/mat_view_run: "Materialized View Run"
|
72
|
+
placeholders:
|
73
|
+
mat_views/mat_view_definition:
|
74
|
+
dependencies: "Enter dependencies (comma separated, optional)"
|
75
|
+
name: "Enter name"
|
76
|
+
refresh_strategy: "Select refresh strategy"
|
77
|
+
schedule_cron: "0 0 * * * for daily at midnight, leave empty for no scheduling"
|
78
|
+
sql: "Enter SQL (SELECT ...)"
|
79
|
+
unique_index_columns: "Enter unique index columns (comma separated, optional)"
|
80
|
+
mat_views/mat_view_run:
|
81
|
+
error: "Error message"
|
82
|
+
mat_view_definition: "Select materialized view"
|
83
|
+
meta: "Metadata (JSON)"
|
84
|
+
operation: "Select operation"
|
85
|
+
status: "Select status"
|
86
|
+
i18n:
|
87
|
+
name: English
|
88
|
+
mat_views:
|
89
|
+
actions: "Actions"
|
90
|
+
all_definitions: "All definitions"
|
91
|
+
all_operations: "All operations"
|
92
|
+
all_statuses: "All statuses"
|
93
|
+
cancel: "Cancel"
|
94
|
+
close: "Close"
|
95
|
+
close_window: "Close window"
|
96
|
+
create: "Create"
|
97
|
+
dashboard:
|
98
|
+
metrics:
|
99
|
+
title: "Metrics"
|
100
|
+
title: "Dashboard"
|
101
|
+
definition: "Definition"
|
102
|
+
definitions: "Definitions"
|
103
|
+
delete: "Delete"
|
104
|
+
details: "Details"
|
105
|
+
edit: "Edit"
|
106
|
+
edit_var: "Edit %{name}"
|
107
|
+
errors:
|
108
|
+
frame_only: "This action can only be performed in a frame, redirected to dashboard."
|
109
|
+
prevented_saving:
|
110
|
+
one: "1 error prevented saving:"
|
111
|
+
other: "%{count} errors prevented saving:"
|
112
|
+
filter_by: "Filter by:"
|
113
|
+
footer:
|
114
|
+
copyright: "© %{year} %{company} All rights reserved."
|
115
|
+
documentation: "Documentation"
|
116
|
+
need_help: "Need guaranteed uptime & expert help?"
|
117
|
+
open_issue: "Open an Issue"
|
118
|
+
project_homepage: "Project Homepage"
|
119
|
+
support: "Get Professional Support →"
|
120
|
+
tagline: "Built with ❤️ by developers, for developers."
|
121
|
+
tooltip:
|
122
|
+
documentation: "Read the documentation"
|
123
|
+
gem_version: "Click to visit the RubyGems page"
|
124
|
+
open_issue: "Report a bug or request a feature"
|
125
|
+
project_homepage: "GitHub repository"
|
126
|
+
support: "Professional support plans"
|
127
|
+
version: "v%{version}"
|
128
|
+
header:
|
129
|
+
signed_in_as: "Signed in as %{email}"
|
130
|
+
history: "History"
|
131
|
+
loading: "Loading..."
|
132
|
+
loading_definitions: "Loading definitions..."
|
133
|
+
loading_runs: "Loading runs..."
|
134
|
+
mat_view_definition:
|
135
|
+
create_mv: "Create MV"
|
136
|
+
create_mv_tooltip: "Creates the materialized view in the database."
|
137
|
+
delete_confirm: "Delete definition %{name}? (Does NOT drop MV)"
|
138
|
+
delete_tooltip: "Deletes the definition but does NOT drop the materialized view in the database."
|
139
|
+
drop_mv: "Drop MV"
|
140
|
+
drop_mv_cascade: "Drop MV (Cascade)"
|
141
|
+
drop_mv_cascade_confirm: "Drop materialized view and all dependent objects for %{name}?"
|
142
|
+
drop_mv_cascade_tooltip: "Drops the materialized view and all dependent objects in the database. Definition remains."
|
143
|
+
drop_mv_confirm: "Drop materialized view for %{name}?"
|
144
|
+
drop_mv_tooltip: "Drops the materialized view in the database. Definition remains."
|
145
|
+
edit_tooltip: "Edit materialized view definition."
|
146
|
+
materialized_view: "Materialized View"
|
147
|
+
materialized_view_exists: "Materialized view exists"
|
148
|
+
materialized_view_not_exists: "Materialized view not created yet!"
|
149
|
+
new_definition: "New definition"
|
150
|
+
new_definition_tooltip: "Create a new materialized view definition."
|
151
|
+
no_definitions: "No materialized view definitions found. Create one to get started."
|
152
|
+
refresh_tooltip: "Refreshes the materialized view in the database."
|
153
|
+
sql_summary_tooltip: "Click to expand/collapse SQL"
|
154
|
+
view_tooltip: "View materialized view definition."
|
155
|
+
mat_view_run:
|
156
|
+
error_tooltip: "Error message if the run failed."
|
157
|
+
meta_tooltip: "Additional metadata in JSON format."
|
158
|
+
no_runs: "No runs found."
|
159
|
+
no_runs_if_filtered: "No runs found for the selected filters."
|
160
|
+
view_details: "View details"
|
161
|
+
view_tooltip: "View run details."
|
162
|
+
project_author: "Codevedas Inc."
|
163
|
+
project_description: "Admin interface for managing PostgreSQL materialized views in Rails applications."
|
164
|
+
project_tags: "rails, ruby, materialized views, admin, dashboard, ui, interface, management"
|
165
|
+
refresh: "Refresh"
|
166
|
+
refresh_contents: "Refresh contents"
|
167
|
+
reloading: "Reloading..."
|
168
|
+
reset: "Reset"
|
169
|
+
run: "Run"
|
170
|
+
runs: "Runs"
|
171
|
+
save_changes: "Save changes"
|
172
|
+
settings:
|
173
|
+
auto: "Auto"
|
174
|
+
dark: "Dark"
|
175
|
+
language: "Language"
|
176
|
+
language_hint: "Choose your interface language."
|
177
|
+
light: "Light"
|
178
|
+
theme: "Theme"
|
179
|
+
theme_hint: "Auto follows your system preference, light and dark overrides it."
|
180
|
+
title: "Preferences"
|
181
|
+
title: "MatViews Admin"
|
182
|
+
view_var: "View %{name}"
|
183
|
+
time:
|
184
|
+
am: "AM"
|
185
|
+
formats:
|
186
|
+
datetime12hour: "%Y-%m-%d %I:%M:%S %p"
|
187
|
+
pm: "PM"
|
data/config/routes.rb
CHANGED
@@ -5,8 +5,32 @@
|
|
5
5
|
# This source code is licensed under the MIT license found in the
|
6
6
|
# LICENSE file in the root directory of this source tree.
|
7
7
|
|
8
|
+
LANG_RE = /[a-z]{2,8}(?:-[A-Za-z0-9]{2,12})?(?:-[A-Za-z0-9]{2,8})?/i
|
8
9
|
MatViews::Engine.routes.draw do
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
scope '(:lang)', constraints: { lang: LANG_RE } do
|
11
|
+
namespace :admin do
|
12
|
+
root to: 'dashboard#index'
|
13
|
+
resource :preferences, only: %i[show update]
|
14
|
+
resources :mat_view_definitions, path: 'definitions' do
|
15
|
+
member do
|
16
|
+
post :create_now
|
17
|
+
post :refresh
|
18
|
+
post :delete_now
|
19
|
+
end
|
20
|
+
end
|
21
|
+
resources :runs, only: %i[index show]
|
22
|
+
|
23
|
+
# redirect to dashboard for unknown paths.
|
24
|
+
get '*path', to: redirect { |params, req|
|
25
|
+
lang = (params[:lang].presence || MatViews::Engine.default_locale).to_s
|
26
|
+
"#{req.script_name}/#{lang}/admin"
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# redirect to admin dashboard for root path including lang.
|
31
|
+
root to: redirect { |params, req|
|
32
|
+
lang = (params[:lang].presence || MatViews::Engine.default_locale).to_s
|
33
|
+
"#{req.script_name}/#{lang}/admin"
|
34
|
+
}
|
35
|
+
end
|
12
36
|
end
|
@@ -5,24 +5,24 @@
|
|
5
5
|
# This source code is licensed under the MIT license found in the
|
6
6
|
# LICENSE file in the root directory of this source tree.
|
7
7
|
|
8
|
-
# This migration creates the mat_view_definitions table, which stores definitions for
|
8
|
+
# This migration creates the mat_view_definitions table, which stores definitions for materialised views.
|
9
9
|
# It includes fields for the view name, SQL definition, refresh strategy, schedule, unique index columns,
|
10
10
|
# dependencies, last refreshed timestamp, and timestamps for creation and updates.
|
11
11
|
class CreateMatViewDefinitions < ActiveRecord::Migration[7.1]
|
12
12
|
def change
|
13
13
|
create_table :mat_view_definitions do |t|
|
14
|
-
t.string :name, null: false, comment: 'The name of the
|
15
|
-
t.text :sql, null: false, comment: 'The SQL query defining the
|
14
|
+
t.string :name, null: false, comment: 'The name of the materialised view'
|
15
|
+
t.text :sql, null: false, comment: 'The SQL query defining the materialised view'
|
16
16
|
# refresh_strategy can be
|
17
17
|
# regular: 0 - Default strategy, in-place refresh.
|
18
18
|
# concurrent: 1 - Concurrent refresh, requires at least one unique index.
|
19
|
-
# swap: 2 - Swap the
|
19
|
+
# swap: 2 - Swap the materialised view with a new one, uses more memory.
|
20
20
|
t.integer :refresh_strategy, default: 0, null: false,
|
21
|
-
comment: 'Strategy for refreshing the
|
22
|
-
t.string :schedule_cron, comment: 'Cron schedule for automatic refresh of the
|
21
|
+
comment: 'Strategy for refreshing the materialised view. Options: regular, concurrent, swap'
|
22
|
+
t.string :schedule_cron, comment: 'Cron schedule for automatic refresh of the materialised view'
|
23
23
|
t.jsonb :unique_index_columns, default: [], comment: 'Columns used for unique indexing, if any'
|
24
24
|
t.jsonb :dependencies, default: [],
|
25
|
-
comment: 'Dependencies of the
|
25
|
+
comment: 'Dependencies of the materialised view, such as other views or tables'
|
26
26
|
t.timestamps
|
27
27
|
end
|
28
28
|
end
|
@@ -5,8 +5,8 @@
|
|
5
5
|
# This source code is licensed under the MIT license found in the
|
6
6
|
# LICENSE file in the root directory of this source tree.
|
7
7
|
|
8
|
-
# This migration creates the mat_view_runs table, which tracks the mutation runs(create,refresh,drop) of
|
9
|
-
# It includes references to the
|
8
|
+
# This migration creates the mat_view_runs table, which tracks the mutation runs(create,refresh,drop) of materialised views.
|
9
|
+
# It includes references to the materialised view definition, status, operation type, timestamps,
|
10
10
|
# duration, error messages, and additional metadata.
|
11
11
|
class CreateMatViewRuns < ActiveRecord::Migration[7.1]
|
12
12
|
def change
|
@@ -14,10 +14,10 @@ class CreateMatViewRuns < ActiveRecord::Migration[7.1]
|
|
14
14
|
t.references :mat_view_definition,
|
15
15
|
null: false,
|
16
16
|
foreign_key: true,
|
17
|
-
comment: 'Reference to the
|
17
|
+
comment: 'Reference to the materialised view definition'
|
18
18
|
|
19
|
-
# 0=
|
20
|
-
t.integer :status, null: false, default: 0, comment: '0=
|
19
|
+
# 0=running, 1=success, 2=failed
|
20
|
+
t.integer :status, null: false, default: 0, comment: '0=running,1=success,2=failed'
|
21
21
|
# 0=create, 1=refresh, 2=drop
|
22
22
|
t.integer :operation, null: false, default: 0, comment: '0=create,1=refresh,2=drop'
|
23
23
|
t.datetime :started_at, comment: 'Timestamp when the operation started'
|