Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not get column info with join #1240

Open
calidion opened this issue Feb 17, 2024 · 0 comments
Open

can not get column info with join #1240

calidion opened this issue Feb 17, 2024 · 0 comments

Comments

@calidion
Copy link

Issues are used to track bugs and feature requests.
Need help or have a general question? Ask on Stack Overflow (tag sqlite.swift).

Build Information

  • Include the SQLite.swift version, commit or branch experiencing the issue.
  • Mention Xcode and OS X versions affected.
  • How do do you integrate SQLite.swift in your project?
    • manual
    • CocoaPods
    • Carthage
    • Swift Package manager

General guidelines

  • Be as descriptive as possible.
  • Provide as much information needed to reliably reproduce the issue.
  • Attach screenshots if possible.
  • Better yet: attach GIFs or link to video.
  • Even better: link to a sample project exhibiting the issue.

code:

            let db = try Connection(url)
            let exam_dates = Table("exam_dates")
            let exams = Table("exam")
            let id = Expression<Int64>("id")
            let examId = Expression<Int64>("examId")
            let examIdJoin = Expression<Int64>("exam.id")
            let examName = Expression<String>("exam.name")
            let examDate = Expression<Date>("exam_dates.date")
            let joins = exams.join(exam_dates, on: exam_dates[examId] == exams[id])
            for join in try db.prepare(joins) {
                let nameValue = try join.get(examName);
                print(nameValue)
            }

error message:

No such column `"exam.name"` in columns ["\"exam\".\"categoryId\"", "\"exam\".\"created_at\"", "\"exam\".\"describe\"", "\"exam\".\"id\"", "\"exam\".\"name\"", "\"exam\".\"updated_at\"", "\"exam_dates\".\"date\"", "\"exam_dates\".\"examId\"", "\"exam_dates\".\"id\""]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant