Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for TEXT column type to CreateTables() #34

Open
spiffytech opened this issue Mar 30, 2013 · 9 comments
Open

Add support for TEXT column type to CreateTables() #34

spiffytech opened this issue Mar 30, 2013 · 9 comments

Comments

@spiffytech
Copy link

Currently CreateTables() interprets all string properties as varchar. Please add support for annotating that the column should be type TEXT instead.

@cloudtrends
Copy link

Yes! +1

To add text is very necessary!

@lukescott
Copy link

There needs to be more control over types. I made a suggestion in this issue here https://github.com/coopernurse/gorp/issues/58.

My biggest issue is some of my types need to be BINARY. For now I think I'm going to create tables manually.

@jamesaanderson
Copy link

👍

2 similar comments
@rvenugopal
Copy link

+1

@marawan-nwh
Copy link

+1

@anentropic
Copy link

seems an elementary feature... issue opened a year ago... no comment from project owner... doesn't look good?

@mauleyzaola
Copy link

I fully agree with the comments above. For me, working only with Postgresql databases it is impossible to take GORM seriously without this feature.

@coopernurse
Copy link
Contributor

The ToSqlType() command in the default dialects is primarily provided as an example. You can easily write your own dialect that implements ToSqlType() with any rules you like.

If you'd like to extend the default dialect, one option is to add an optional field to PostgresDialect that specifies the cutoff for maxsize that would dictate whether to use a text field. But this is a slippery slope that may further reinforce the idea that the provided dialect implementations are intended to satisfy all use cases.

@GeertJohan GeertJohan added this to the v2.1-maybe milestone Jul 1, 2015
@sinni800
Copy link

sinni800 commented Jun 23, 2016

I think a really easy change would be to add a new attribute to ColumnMap to override the SQL type. Since TEXT, for example, can be used just like varchar anyway, that could work out in this case.

I mean we can override the column size, so why not the column type, too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests