Select Type Error: can't convert attribute to interval

Open
#276 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby, sql
Domain
database

Research direction

Start with the combined-relation and node(:slot_templates) example in the issue, comparing select with the working project call. Build a minimal reproduction for the reported TypeError, then verify that select with the renamed schema produces the desired output without requiring project.

Written by the indexing model from the issue text.

Description

bug unconfirmed

rom v4.1.3

I ran into a similar issue to this
https://discourse.hanamirb.org/t/select-clause-in-a-repository/396/4

I don't have a repo script yet but I was trying to combine two relations and edit one of the nodes, eg:

campaign_region_relation
  .join(:base_region)
  .combine(slot_templates: :slot_types)
  .node(:slot_templates) do |r|
    r.select(*r.schema.rename(slot_template_key: :key))
  end

would result in
TypeError: can't convert ROM::SQL::Attribute into time interval

But change select to project and I'd get the desired output

Dominant language
Ruby
Stars
220
Forks
97
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rom-rb/rom-sql

All issues in rom-rb/rom-sql

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.