Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-07-10 15:08:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-07-10 15:08:58 +0300
commit215001eca7ababe4c617a04a37d307a97353d6e0 (patch)
tree50c65a921667c43d58f09cd1e900d4854285adcc /gems/gitlab-schema-validation/lib/gitlab/schema/validation/schema_objects/base.rb
parent4a6c33b8a49bea08205a77d53d4425b9c23845b4 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'gems/gitlab-schema-validation/lib/gitlab/schema/validation/schema_objects/base.rb')
-rw-r--r--gems/gitlab-schema-validation/lib/gitlab/schema/validation/schema_objects/base.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/gems/gitlab-schema-validation/lib/gitlab/schema/validation/schema_objects/base.rb b/gems/gitlab-schema-validation/lib/gitlab/schema/validation/schema_objects/base.rb
new file mode 100644
index 00000000000..1af7a67ddb6
--- /dev/null
+++ b/gems/gitlab-schema-validation/lib/gitlab/schema/validation/schema_objects/base.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Schema
+ module Validation
+ module SchemaObjects
+ class Base
+ def initialize(parsed_stmt)
+ @parsed_stmt = parsed_stmt
+ end
+
+ def name
+ raise NoMethodError, "subclasses of #{self.class.name} must implement #{__method__}"
+ end
+
+ def table_name
+ parsed_stmt.relation.relname
+ end
+
+ def statement
+ @statement ||= PgQuery.deparse_stmt(parsed_stmt)
+ end
+
+ private
+
+ attr_reader :parsed_stmt
+ end
+ end
+ end
+ end
+end