Python 靠近';的语法不正确';,应为ID、带引号的ID、字符串或文本
这是一个文件Python 靠近';的语法不正确';,应为ID、带引号的ID、字符串或文本,python,sqlite,flask,Python,Sqlite,Flask,这是一个文件schema.sql,我正在用Flask上的SQLite进行编码。我在autoincrement旁边的逗号上收到一条语法错误消息。我想知道这有什么问题 drop table if exists entries; create table entries ( id integer primary key autoincrement, title text not null, 'text' text not null ); [这是schema.sq
schema.sql
,我正在用Flask上的SQLite进行编码。我在autoincrement旁边的逗号上收到一条语法错误消息。我想知道这有什么问题
drop table if exists entries;
create table entries
(
id integer primary key autoincrement,
title text not null,
'text' text not null
);
[这是schema.sql的图像]
实际上,我不知道如何检查sql文件的错误,因为我刚刚开始通过教程“Flask”学习sqlite
这是我学习的网页
我正在使用Vscode作为编辑器,当我将鼠标光标悬停在上面有红线的逗号上时,我看到了这条消息。我在SQLite中尝试了您的查询;查询本身似乎工作得很好
$ sqlite3 foo.sqlite
SQLite version 3.19.3 2017-06-27 16:48:08
Enter ".help" for usage hints.
sqlite> drop table if exists entries;
sqlite> create table entries ( id integer primary key autoincrement, title text not null, 'text' text not null );
sqlite> .schema entries
CREATE TABLE entries ( id integer primary key autoincrement, title text not null, 'text' text not null );
sqlite> INSERT INTO entries (title, 'text') VALUES ('foo-title', 'foo-text');
sqlite> SELECT * FROM entries;
1|foo-title|foo-text
sqlite> ^D
$
可能错误在别处。显示实际的错误消息。