gnormal / gnorm

A database-first code generator for any language
https://gnorm.org
Other
488 stars 40 forks source link

add support for indexes #70

Closed Etomyutikos closed 6 years ago

Etomyutikos commented 6 years ago

resolves #2 This commit introduces new fields to the Table template object that expose index information. This information includes the database name of the index (DBName) and the Columns used in the index. Exposing the database name as DBName seemed more appropriate than Name because Name is converted everywhere else; a converted name for an index didn't make sense to me.

The MySQL implementation uses a generated table (information_schema.STATISTICS).

The Postgres implementation uses a handwritten SQL query, much like other functions in database/drivers/postgres/parse.go.

natefinch commented 6 years ago

Sorry about the conflicts! Hopefully they're not too bad to resolve.

natefinch commented 6 years ago

Glorious!