Skip to content

[BUG] Incorrect syntax when export as DBML #364

Description

@plohan

Describe the bug
DBML export column settings incorrectly when there are multiple settings and also export on update incorrectly. The output of column setting does not have comma separate value and on update has extra on which is not suppose to be there. The builtin example can easily reproduce the bug.

I'm not sure whether this kind of bug exists as I only found these two.

To Reproduce
Steps to reproduce the behavior:

  1. Go to "File" > "New" > "Blog database schema" > "Create"
  2. Go to "File" > "Export as" > "DBML" then save file locally
  3. Go to "File" > "New" > "Blan" > "Sqlite" > "Create"
  4. Go to "File" > "Import from" > "DBML" and import file from step 3.
  5. See error

Expected behavior
According to the official examples on column setting and update, there should be comma between each column setting and use update instead of on update.

Screenshots
Image

Desktop (please complete the following information):

  • OS: OSX
  • Browser: Chrome

Additional context
I took a quick glance at the export code and found what should be the cause

Here is a part of DBML file, the incorrect syntax is notated above.

Table users {     VVV       VVV      VVV
	id int [ pk increment not null unique ]
	username varchar
	password varchar
	email varchar
	last_login timestamp
}
...
Ref blog_tag_blog_id_fk {                                             VVV
	blog_tag.blog_id undefined blog_posts.id [ delete: no action, on update: no action ]
}

Anyway, thanks for the good work you've done.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions