can't do crud operation using grom orm, grom doesn't identify the mysql tables

xuanbao · · 698 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m trying to do crud operation using grom and mysql. when i do that i got a problem that grom didn&#39;t i identify the correct table in the mysql it gives following error when run the app</p> <p>(/api/controllers/table.go:30) [2016-03-23 09:56:39] [0.99ms] SELECT * FROM <code>tables</code><br/> 2016/03/23 09:56:39 Error when looking up tables, the error is &#39;&amp;{0xc8202140e0 sql: Scan error on column index 3: unsupported driver -&gt; Scan pair: []uint8 -&gt; *time.Time 1 &lt;nil&gt; 0xc82022f860 0xc82022f7c0 0xc82021e140 2 {0xc8201fb4a0} &lt;nil&gt; false map[] map[]}&#39; [GIN] 2016/03/23 - 09:56:39 | 404 | 1.153811ms | 127.0.0.1 | GET /table</p> <p>what the reason for this ? and i did post a question in stack-overflow also plz take a look at that also (<a href="http://goo.gl/xoYuaT" rel="nofollow">http://goo.gl/xoYuaT</a>)</p> <hr/>**评论:**<br/><br/>hayzeus: <pre><p>This sounds like an issue with your driver, not gorm. I use gorm, but with postgres, so I don&#39;t know what the specific deal is with mysql.</p> <p>Here&#39;s an example of using gorm with mysql: <a href="https://github.com/ant0ine/go-json-rest-examples/blob/master/gorm/main.go" rel="nofollow">https://github.com/ant0ine/go-json-rest-examples/blob/master/gorm/main.go</a></p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

698 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传