Giter Club home page Giter Club logo

Comments (5)

smallnest avatar smallnest commented on May 17, 2024

need err details about the error

from gen.

noclear avatar noclear commented on May 17, 2024

need err details about the error

when i add fmt.Println("q=",q) fmt.Println("err=",err) in github.com/jimsmart/schema/schema.go file on line 177.

the print is :
q= SELECT * FROM ```user``` LIMIT 0
err= Error 1146: Table 'test.`user`' doesn't exist

that is because add extra `` on tableName in the code :
cols, _ := schema.Table(db, fmt.Sprintf(tableNameFormat[sqlType], tableName))

from gen.

smallnest avatar smallnest commented on May 17, 2024

你的comment没格式化,看不清你具体问题,貌似你说的问题是因为SELECT * FROM `user` LIMIT 0中表的名称前后被加上了上撇号?

事实上这是mysql支持的,因为有些表明是sql关键字,直接写会有问题,比如likewhere

image

from gen.

noclear avatar noclear commented on May 17, 2024

2
导致的问题跟 #30 一样的.

from gen.

smallnest avatar smallnest commented on May 17, 2024

#23 引入的escape tablename,为了解决特殊表名的问题,之后 jimsmart/schema 也加入了这个修复,所以会导致重复 escape的问题。

我reverted #23, go get -u -v github.com/smallnest/gen 更新一下gen再测试一下,应该可以了

from gen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.