Skip to content

Bug: If Parent cluster doesnt exists when creating record, error thrown #306

@SchoolyB

Description

@SchoolyB

Steps to recreate this bug:

  1. Login to CLI
  2. Create a collection NEW foo
  3. Then attempt to create a record inside the existing collection foo and the non-existent cluster bar:
    NEW foo.bar.baz OF_TYPE []INT WITH 1,2,3,4,5

Because cluster bar does not exist yet this throws an error. But what should happen is the program should notify to the user "Hey cluster bar doesnt exist within collection foo, would you like to create this first and then create the record baz?"


The logic explained above does correctly work when performing the following operation:
Note: Imagine collection foo and thus cluster bar do not exist

NEW foo.bar.baz OF_TYPE []INT WITH 1,2,3,4,5

Example Program output:
 OstrichDB is about to perform several automatic operations for you.
 Operations:

 Create collection - foo
 Create cluster - bar

Would you like to continue? [Y/n]

The work for this issue will be done in src/engine/data/auto.doin

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions