- BREAKING CHANGES: support for indexes
sqlschm is now able to parse indexes such as:
sql
CREATE INDEX person_major_index ON person(age) WHERE major > 18;
As a consequence, we renamed `tables` of `sql.Schema` by `items`.
You can update your code in the following way:
py
from
schema.tables
to
schema.tables()
`schema.indexes()` returns all indexes.
- BREAKING CHANGES: remove sql.Alias
py
from
foreign_key.foreign_table.name
to
foreign_key.foreign_table
- Add helper functions
`sql.referred_columns` allows computing referred columns by a foreign key.
If referred columns are unspecified, then the function returns
the columns of the primary key of the foreign table.
`sql.test_resolve_foreign_key` traverse the graph of references
until a column that is not a foreign key is found.
Traversed foreign keys are yield.
Note that this may produce an endless sequence of foreign keys
in the case of cyclic foreign keys.