{"action":"created","issue":{"url":"https://api.github.com/repos/jinzhu/gorm/issues/757","labels_url":"https://api.github.com/repos/jinzhu/gorm/issues/757/labels{/name}","comments_url":"https://api.github.com/repos/jinzhu/gorm/issues/757/comments","events_url":"https://api.github.com/repos/jinzhu/gorm/issues/757/events","html_url":"https://github.com/jinzhu/gorm/issues/757","id":121826145,"number":757,"title":"Spatial types","user":{"login":"devfubar","id":7021489,"avatar_url":"https://avatars.githubusercontent.com/u/7021489?v=3","gravatar_id":"","url":"https://api.github.com/users/devfubar","html_url":"https://github.com/devfubar","followers_url":"https://api.github.com/users/devfubar/followers","following_url":"https://api.github.com/users/devfubar/following{/other_user}","gists_url":"https://api.github.com/users/devfubar/gists{/gist_id}","starred_url":"https://api.github.com/users/devfubar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devfubar/subscriptions","organizations_url":"https://api.github.com/users/devfubar/orgs","repos_url":"https://api.github.com/users/devfubar/repos","events_url":"https://api.github.com/users/devfubar/events{/privacy}","received_events_url":"https://api.github.com/users/devfubar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-12T02:10:28Z","updated_at":"2015-12-12T11:20:50Z","closed_at":"2015-12-12T02:26:15Z","body":"Hi,\r\n\r\nIf I have the following struct;\r\n\r\n```go\r\ntype Location struct {\r\n\tgorm.Model\r\n\r\n\tUserID uint `sql:\"index\"`\r\n\r\n\tLine1   string\r\n\tLine2   string\r\n\tTown    string\r\n\tCounty  string\r\n\tCountry string\r\n\r\n\tPoint geo.Point `sql:\"type:point\"`\r\n}\r\n```\r\nI can select rows easily if I use \"https://github.com/paulmach/go.geo\" (it implements the scan interface).\r\n\r\nTo insert spatial data I can use the following SQL;\r\n\r\n```sql\r\nINSERT INTO 'locations' ('point') VALUES (GeomFromText('POINT(10 10)'));\r\n```\r\n\r\nCurrently `db.Create` generates this insert;\r\n\r\n```sql\r\nINSERT INTO `locations` (`created_at`,`updated_at`,`deleted_at`,`line1`,`line2`,`town`,`county`,`country`,`point`,`user_id`) VALUES ('2015-12-12T00:37:06Z','2015-12-12T00:37:06Z','<nil>','10','Fubar Road','Madeupvill','Test province','no where','POINT(10 10)','2')\r\n```\r\nClose but how to I get the function *GeomFromText* in front of the string *POINT(10 10)* in the values? I am trying really hard to avoid using raw sql statements.\r\n\r\nhttp://stackoverflow.com/questions/34234027/golang-sql-driver-database-functions/34234432 shows one way I was trying"},"comment":{"url":"https://api.github.com/repos/jinzhu/gorm/issues/comments/164139767","html_url":"https://github.com/jinzhu/gorm/issues/757#issuecomment-164139767","issue_url":"https://api.github.com/repos/jinzhu/gorm/issues/757","id":164139767,"user":{"login":"devfubar","id":7021489,"avatar_url":"https://avatars.githubusercontent.com/u/7021489?v=3","gravatar_id":"","url":"https://api.github.com/users/devfubar","html_url":"https://github.com/devfubar","followers_url":"https://api.github.com/users/devfubar/followers","following_url":"https://api.github.com/users/devfubar/following{/other_user}","gists_url":"https://api.github.com/users/devfubar/gists{/gist_id}","starred_url":"https://api.github.com/users/devfubar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devfubar/subscriptions","organizations_url":"https://api.github.com/users/devfubar/orgs","repos_url":"https://api.github.com/users/devfubar/repos","events_url":"https://api.github.com/users/devfubar/events{/privacy}","received_events_url":"https://api.github.com/users/devfubar/received_events","type":"User","site_admin":false},"created_at":"2015-12-12T11:20:50Z","updated_at":"2015-12-12T11:20:50Z","body":"Thanks for getting back to me.\r\n\r\nIs there a way to make spatial types a feature request?  If I get a bit of direction I don't mind doing a PR as it would be great to have this.  I use them a lot."}}