import sqlparseSQL = """CREATE TABLE foo (id integer primary key,title varchar(200) not null,description text);"""parsed = sqlparse.parse(SQL)[0]# extract the parenthesis which holds column definitionspar = parsed.token_next_by_instance(0, sqlparse.sql.Parenthesis)# assumes that token_list is a parenthesisdefinitions = []# grab the first token, ignoring whitespacetoken = par.token_next(0)
I am working on Python 2.6 (Oct. 2008) is this a wrong Python version ?
--
You received this message because you are subscribed to the Google Groups "sqlparse" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sqlparse/-/vhbKIQqtLSoJ.
To post to this group, send email to sqlp...@googlegroups.com.
To unsubscribe from this group, send email to sqlparse+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sqlparse?hl=en.