Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sqlite schema has quotes around table name after a table rename

Tags:

sqlite

schema

I had to rename an existing table in my sqlite database using the following command:

ALTER TABLE users RENAME TO widgets;

After running that command, when I check the schemas using the .schema command, this is what I see:

CREATE TABLE "widgets"(id integer primary key AUTOINCREMENT, widget_tag varchar(10), destination varchar(100), class varchar(10), name varchar(255), grp active bit(1));
CREATE TABLE uu(id integer primary key AUTOINCREMENT, uu_name varchar(255), email varchar(255), active bit(1));

Notice the quotes around the table name. I'm not sure if that's a bad thing or not. My web application runs just fine and I'm able to update / delete / select records no problem.

Can someone tell me what these quotes are and if I need to worry ? Thanks.

like image 813
dot Avatar asked Nov 07 '25 04:11

dot


1 Answers

As far as I am aware, you have nothing to worry about. The quotes simply define the name of the table as a string literal to SQLite. You would only need to worry if the value came back with the double quotes in "widgets" escaped, which you would have seen in your schema check as ""widgets"".

like image 57
Jonathan Ochs Avatar answered Nov 11 '25 13:11

Jonathan Ochs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!