Sqlite: adding comments to tables and columns?

前端 未结 3 1089
醉酒成梦
醉酒成梦 2021-02-05 01:38

In MySQL Workbench you can add comments to tables and columns in a MySQL database.

Does Sqlite support adding comments to tables and columns?

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-05 01:56

    When creating a table using sqlite (I'm using sqlite3 in python), the COMMENT section is not supported.

    This fails (works in full MySql syntax):

    CREATE TABLE `Info` (
      `Test` VARCHAR(512) NOT NULL COMMENT 'Column info here'
    );
    

    This works (no COMMENT in the column declaration):

    CREATE TABLE `Info` (
      `Test` VARCHAR(512) NOT NULL
    );
    

提交回复
热议问题