JacobLinCool / JacobLinCool/d1-manager

Error occurs when adding data with preset function values.

Open
#61 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Svelte
Stars
645
Forks
335
PR merge metrics
No merged PRs in 30d

Description

I have set my data table with the following code:
`create_time TEXT DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ', 'now'))`
This is to automatically fill in the date when manually adding data.

At least that's how it works on the data table operation page in Cloudflare D1. However, when I tried to do the same in the program of this repository, it automatically filled in the text of the default function `strftime('%Y-%m-%dT%H:%M:%SZ', 'now')` itself.
![image](https://github.com/JacobLinCool/d1-manager/assets/159799757/6a2df416-974c-411f-a49b-abc4661c2e2e)

Typically, it should work like this: automatically filling in the date when adding.
![image](https://github.com/JacobLinCool/d1-manager/assets/159799757/bf7c3cc1-2ad7-4e2f-b404-7f8d59b83461)

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue does not name a file or test. Reproduce the problem by creating a table with the shown SQLite default expression and adding a record through the repository's data-table interface. Trace how column defaults are read and applied; done means function-valued defaults produce a generated timestamp rather than the expression text.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.