duckdb / duckdb/duckdb-sqlite

COPY FROM DATABASE SQLite to DuckDB - Catalog Error

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

Description

### What happens?

Hi,
It cannot be copied due to the CHECK constraint in a column of the SQLite table. I understand it. Because DuckDB does not contain a function called Datetime. When adding valid CHECK constraints to the SQLite table for DuckDB, the database is copied without CHECK constraints. CHECK constraints are not copied anyway. I think it might be a good idea to ignore CHECK restrictions when copying the SQLite database. The same applies to SQLite indexes.

### To Reproduce

SQLite:
```sql
CREATE TABLE if not exists test(
insertTime DATETIME CHECK(Datetime(insertTime ,'+0 days') IS substr(insertTime ,1,19)),
anynteger INTEGER CHECK(anynteger>=0)
);
```

DuckDB:
```sql
attach 's8test.db' as du;
attach 's8.db' as sl (TYPE SQLITE);
COPY FROM DATABASE sl TO du;
```
```
Catalog Error: Scalar Function with name datetime does not exist!
Did you mean "make_time"?
LINE 1: COPY FROM DATABASE sl TO du (SCHEMA);
```

### OS:

Windows

### DuckDB Version:

v1.0.0

### DuckDB Client:

.net (NuGet)

### Full Name:

Serdar Didan

### Affiliation:

--

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

I have tested with a stable release

### 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.