Is there a way to get a schema of a database from within python?

前端 未结 10 1932
走了就别回头了
走了就别回头了 2020-12-09 16:06

I\'m trying to find out a way to find the names of tables in a database(if any exist). I find that from a sqlite cli I can use:

>.tables
<
10条回答
  •  Happy的楠姐
    2020-12-09 17:02

    To get the schema information, IMHO, below also works:

    select sql from sqlite_master where type='table';
    

提交回复
热议问题