[英]Laraadmin and sqlite “SHOW”: syntax error (SQL: SHOW TABLES)
I have installed laraadmin as for quick admin with using sqlite. 我已经安装了laraadmin,以便使用sqlite进行快速管理。 But problem is when i am going to create something getting SQLSTATE[HY000]: General error: 1 near "SHOW": syntax error (SQL: SHOW TABLES) Thanks
但是问题是当我要创建获取SQLSTATE [HY000]的东西时:常规错误:在“ SHOW”附近出现1:语法错误(SQL:SHOW TABLES)谢谢
Unfortunately SQLite doesn't know SHOW TABLES
, but instead it has: 不幸的是,SQLite不知道
SHOW TABLES
,但是它具有:
special command line commands , like .schema
or .tables
(with optional LIKE
patterns) 特殊的命令行命令 ,例如
.schema
或.tables
(带有可选的LIKE
模式)
a master metadata table , called sqlite_master
主元数据表 ,称为
sqlite_master
So let's say you have the following tables: 因此,假设您有以下表格:
sqlite> CREATE TABLE A(a INT, b, INT, c TEXT);
sqlite> CREATE TABLE B(a INT);
sqlite> CREATE TABLE AB(a TEXT, b TEXT);
You can query the schema: 您可以查询架构:
sqlite> .schema
CREATE TABLE A(a INT, b, INT, c TEXT);
CREATE TABLE B(a INT);
CREATE TABLE AB(a TEXT, b TEXT);
Query the table names: 查询表名:
sqlite> .tables
A AB B
Query all the metadata: 查询所有元数据:
sqlite> SELECT * FROM sqlite_master WHERE type = 'table';
table|A|A|2|CREATE TABLE A(a INT, b, INT, c TEXT)
table|B|B|3|CREATE TABLE B(a INT)
table|AB|AB|4|CREATE TABLE AB(a TEXT, b TEXT)
Query the schema of table names matching a specific LIKE
pattern: 查询与特定
LIKE
模式匹配的表名的模式:
sqlite> .schema A%
CREATE TABLE A(a INT, b, INT, c TEXT);
CREATE TABLE AB(a TEXT, b TEXT);
Query the table names matching a specific LIKE
pattern: 查询与特定
LIKE
模式匹配的表名:
sqlite> .tables A%
A AB
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.