GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Emit ORM-specific database tags · Issue #658 · sqlc-dev/sqlc Closed Labels futureIn the year 3000...In the year 3000... Description#656 added support for adding By design, the For sqlx, I don't think there's anything else the db tag can do. For gorp, this would involve setting attribute like primary key, autoincrement, and size: type Post struct { // db tag lets you specify the column name if it differs from the struct field Id int64 `db:"post_id"` Created int64 Title string `db:",size:50"` // Column size set to 50 Body string `db:"article_body,size:1024"` // Set both column name and size } // Example of using tags to alias fields to column names // The 'db' value is the column name // // A hyphen will cause gorp to skip this field, similar to the // Go json package. // // This is equivalent to using the ColMap methods: // // table := dbmap.AddTableWithName(Product{}, "product") // table.ColMap("Id").Rename("product_id") // table.ColMap("Price").Rename("unit_price") // table.ColMap("IgnoreMe").SetTransient(true) // // You can optionally declare the field to be a primary key and/or autoincrement // type Product struct { Id int64 `db:"product_id, primarykey, autoincrement"` Price int64 `db:"unit_price"` IgnoreMe string `db:"-"` } GORM has a huge set of options, as the tags are used instead of DDL statements. There is currently no plan to work on this until we have a specific user that needs this support and is willing to work closely with us on implementation ActivityMetadataMetadataAssigneesLabelsfutureIn the year 3000...In the year 3000... TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |