Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
M
massive-js
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 10
    • Issues 10
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 2
    • Merge requests 2
  • Requirements
    • Requirements
    • List
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Dian Fay
  • massive-js
  • Issues
  • #704

Closed
Open
Created Dec 01, 2019 by Bono S@bs85Contributor

join(),find() error within transaction when no fkey defined

I have 2 tables, customers and details. details has a nullable customer_id column, but no foreign key is defined (legacy, not an option for now).

The following code fails:

database.withTransaction((tx) => tx.customers.join({ details: {
   relation: 'details',
   type: 'INNER',
   on: { customer_id: 'id' },
   decomposeTo: 'object',
}}).find(1))

The error is from lib/util/parse-keys.js:142, const matched = source.joins.some(j => {

source.joins is undefined

Running the same code without transaction works as expected, e.g.:

database.customers.join({ details: {
   relation: 'details',
   type: 'INNER',
   on: { customer_id: 'id' },
   decomposeTo: 'object',
}}).find(1))

Creating the foreign key (possible on test data) and running the same code also fixes the problem.

I can take the time to create a minimal repro if needed, let me know.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking