duckdb / duckdb/duckdb-sqlite

SQLite `.schema` fails in parsing with table + index

Open
#137 0 comments 0 reactions 0 assignees View on GitHub
reproduced
Dominant language
C
Stars
291
Forks
45
Avg merge
10h 13m
Merged PRs (30d)
18

Description

### What happens?

The `.schema` command fails to print the schema of a table.

### To Reproduce

This is all from the CLI. Versions included in the code block:

```
$ sqlite3 example.db
SQLite version 3.49.0 2025-02-06 11:55:18
Enter ".help" for usage hints.
sqlite> create table example(x int);
sqlite> create unique index UQE_example_x ON `example` (`x`);

$ duckdb example.db
v1.2.0 5f5512b827
Enter ".help" for usage hints.
D .schema example
Parser Error:
syntax error at or near "`"

LINE 1: SELECT sql FROM sqlite_master WHERE lower(tbl_name) LIKE 'example' ESCAPE '\' AND type!='meta...
```

With nightly DuckDB:

```
./duckdb ../example.db
v1.2.1-dev308 6571dca3c0
Enter ".help" for usage hints.
D .schema example
Parser Error:
syntax error at or near "`"

LINE 1: SELECT sql FROM sqlite_master WHERE lower(tbl_name) LIKE 'example' ESCAPE '\' AND type!='meta...
```

### OS:

Arch Linux x86_64

### DuckDB Version:

v1.2.0 5f5512b827

### DuckDB Client:

v1.2.0 5f5512b827

### Hardware:

Ryzen 7 PRO 8840HS

### Full Name:

Mariell Hoversholm

### Affiliation:

Grafana Labs

### What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a nightly build

### Did you include all relevant data sets for reproducing the issue?

Yes

### Did you include all code required to reproduce the issue?

- [x] Yes, I have

### Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

- [x] Yes, I have

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.