Class: Omen::Schema

Inherits:
Object
  • Object
show all
Defined in:
app/models/omen/schema.rb

Overview

What Claude writes its SQL against: the app's own schema, less what the role may not read.

Constant Summary collapse

HINT =

A plain index is a note about speed; a unique one is a fact about the rows, so it stays.

/^\s*t\.index (?!.*unique: true).*\n/

Instance Method Summary collapse

Constructor Details

#initialize(role) ⇒ Schema

Returns a new instance of Schema.

Parameters:

  • role (String) —

    the Postgres role the statement will run as.



7
8
9
# File 'app/models/omen/schema.rb', line 7

def initialize(role)
  @role = role
end

Instance Method Details

#text ⇒ String

Returns the schema, without a table or a column the role is refused, and without an enum or a foreign key left behind by one.

Returns:

  • (String) —

    the schema, without a table or a column the role is refused, and without an enum or a foreign key left behind by one.



13
# File 'app/models/omen/schema.rb', line 13

def text = without_orphan_enums without_columns without_tables source