Opts[:from] is nil


#1

I am experimenting with bring rom-rb into an existing project. And am getting the following error:

rom-sql-2.2.0/lib/rom/sql/relation.rb:36:in `block (2 levels) in class:Relation’: undefined method first for nil:NilClass (NoMethodError)

This is line 36 of relation.rb:

table = opts[:from].first

opts has the value { sql: "dbo.members" }

I have the following Relation:

class TeamMemberRelation < ROM::Relation[:sql]
  gateway :default

  schema("dbo.members", as: :team_members, infer: true)
end

If I change line 36 to table = opts[:sql].first everything seems to work. What am I doing wrong?


#2

PG’s schemas are not supported yet. There’s an issue about adding support for this.