-
Notifications
You must be signed in to change notification settings - Fork 119
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
go-jet can't generate table model files and table sql builder files #241
Comments
I get a very similar thing with the two tables below. Let me know if it's ok to keep these in the same issue, or if I should open a new one This one fails because someone messed up the second column name. It appears they programmatically generated the table and forgot to add an alias for the column name. Ignoring the table during the gen phase was enough to get around this, as I don't need this table in my app: CREATE TABLE `Compliance` (
`PatientID` int(11) DEFAULT NULL,
`Concat(Patients.LastName, ', ', Patients.FirstName)` varchar(102) COLLATE utf8_unicode_ci DEFAULT NULL,
`Type` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`Label` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB;
And this one the CREATE TABLE `Rules` (
`RuleID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Label` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`RuleSQL` varchar(4000) COLLATE utf8_unicode_ci DEFAULT NULL,
`Allowance` int(10) unsigned DEFAULT '0',
`AllowEmptySet` tinyint(1) unsigned DEFAULT '0',
`Operator` enum('=','!=','<=','>=','<','>','IN') COLLATE utf8_unicode_ci DEFAULT NULL,
`TableName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB;
|
Hi @Chinnasit , @joefrancia , |
@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 worksEnvironment (please complete the following information):
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
The text was updated successfully, but these errors were encountered: