Skip to content

When no DB used we get: Code: 57. DB::Exception: Directory for table data data/default/testtable/ already exists. (TABLE_ALREADY_EXISTS) #18

Open
@ceckoslab

Description

@ceckoslab

I noticed that in the following conditions I get when I run the example script for second time:

Code: 57. DB::Exception: Directory for table data data/default/testtable/ already exists. (TABLE_ALREADY_EXISTS)

Repro:

const { query, Session } = require("chdb");

var ret;

// Test standalone query
ret = query("SELECT version(), 'Hello chDB', chdb()", "CSV");
console.log("Standalone Query Result:", ret);

// Test session query
// Create a new session instance
const session = new Session("./dir_for_table_already_exists");

session.query("CREATE TABLE IF NOT EXISTS testtable (id UInt32) ENGINE = MergeTree() ORDER BY id;");

I usually create a new DB and use the new DB but not everyone would be doing the same and could reach the same problem.

System info:

Apple M2 Pro
macOS 14.5 (23F79)
Node v20.9.0

  "dependencies": {
    "chdb": "^1.2.1"
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions