gnormal / gnorm

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

add support for indexes #70

Closed Etomyutikos closed 7 years ago

Etomyutikos commented 7 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 7 years ago

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

natefinch commented 7 years ago

Glorious!