drawdb icon indicating copy to clipboard operation
drawdb copied to clipboard

[BUG] Cannot import SQL with checks on column level

Open drloloto opened this issue 1 year ago • 2 comments

Describe the bug When Import from SQL is used it fails on importing checks

To Reproduce Steps to reproduce the behavior:

  1. import the .ddb file
  2. export as sql as it is
  3. import the same file again

Expected behavior should import

Screenshots image bug.zip

Desktop (please complete the following information) :

  • postgres
  • OS: Windows
  • Browser Arc Browser (chromium)

drloloto avatar Aug 04 '24 10:08 drloloto

Yep the parser seems to fails on checks. Can you please attach the sql file

1ilit avatar Aug 04 '24 12:08 1ilit

Yep the parser seems to fails on checks. Can you please attach the sql file

I added the .zip :)

drloloto avatar Aug 05 '24 07:08 drloloto

This isn't supposed to work. The CHECK isn't valid sql that's why the parser is failing as it should.

1ilit avatar Aug 06 '24 07:08 1ilit

This isn't supposed to work. The CHECK isn't valid sql that's why the parser is failing as it should.

I think the tooltip is misleading then: image

But thanks for the clarification. Greetings!

drloloto avatar Aug 07 '24 05:08 drloloto

@drloloto how would you change it

1ilit avatar Aug 07 '24 06:08 1ilit

@drloloto how would you change it

I imported a SQL Script from supabase and probably some internal functions like auth.id() didn't get recognized by drawdb.

I think it would be neat to let the user choose to use drawdb expression check or to just use plain text. Maybe a small checkbox next to the text in my screenshot and one on the import from sql modal with "ignore expression checks" could be a solution.

drloloto avatar Aug 08 '24 07:08 drloloto