Skip to content

go-jet can't generate table model files and table sql builder files #241

@Chinnasit

Description

@Chinnasit

Describe the bug
when using the command :
jet -source=mysql -dsn="user:pass@tcp(localhost:3306)/dbname" -path=./gen

command output :
Connecting to MySQL database...
Retrieving database information...
FOUND 1 table(s), 0 view(s), 0 enum(s)
Destination directory: gen/book_store
Cleaning up destination directory...
Generating table model files...
17:1: expected '}', found 1 (and 1 more errors)

but when I delete a comment in the SQL command COMMENT 'e\r\n1' so jet generator works

Environment (please complete the following information):

  • OS : Windows
  • Database : AWS RDS for MySQL
  • Database driver : [e.g. pq, pgx]
  • Jet version : 2.10.0

Code snippet
SQL Editor in DBeaver :
CREATE TABLE books (
id int NOT NULL AUTO_INCREMENT,
rate decimal(10,2) DEFAULT '0.00' COMMENT 'e\r\n1',
PRIMARY KEY (id)
)ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4;

Expected behavior
can generate table model files and table sql builder files

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions