Fix SQLite table creation sql (#8430)

# Description

The "CREATE TABLE" statement in `into sqlite` does not add quotes to the
column names, reproduction steps are below:

```
/home/xxx〉[[name,y/n];[a,y]] | into sqlite test.db
Error: 
  × Failed to prepare SQLite statement
   ╭─[entry #1:1:1]
 1 │ [[name,y/n];[a,y]] | into sqlite test.db
   ·                                                       ───┬───
   ·                                                             ╰── near "/": syntax error in CREATE TABLE IF NOT EXISTS main (name TEXT,y/n TEXT) at offset 44
   ╰────
```

# User-Facing Changes

None

---------

Co-authored-by: Reilly Wood <reilly.wood@icloud.com>
This commit is contained in:
BlacAmDK 2023-03-14 01:11:28 +08:00 committed by GitHub
parent 79d0735864
commit 86faf753bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,7 +117,7 @@ fn action(
let table_columns_creation = columns
.iter()
.map(|(name, sql_type)| format!("{name} {sql_type}"))
.map(|(name, sql_type)| format!("\"{name}\" {sql_type}"))
.join(",");
// get the values