Skip to content

extract columns from given schema same as PRAGMA table_info #506

Description

@AliM1988

Suppose we have a new schema as a text. How to extract columns from new schema same as PRAGMA table_info?

Actually I want to compare new schema (provided as a text string) with existing one in current database.

Sample:

new_schema='''
CREATE TABLE sqlite_schema(
  type text,
  name text,
  tbl_name text,
  rootpage integer,
  sql text
)
'''

parser = sql_metadata.Parser(new_schema)
columns = parser.columns

parser.columns just returns columns name, but I need a format same as PRAGMA table_info:
(cid, name, type, notnull, dflt_value, pk)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions