holistics / dbml

Database Markup Language (DBML), designed to define and document database structures
https://dbml.org
Apache License 2.0
2.9k stars 170 forks source link

Fix: When the parameter format is JSON in Parser.parse, the first parameter 'parse' must be RawDatabase #629

Closed Mrxyy closed 2 months ago

Mrxyy commented 2 months ago

Summary

The Database.constructor parameter requires RawDatabase because the Database.export method executed by ModelExporter.export (format=json) returns a regular object instead of RawDatabase, which is different from RawDatabase. Therefore, when using Parser.parse(str, format=json), str must be in RawDatabase or its json form to alert everyone about unexpected errors caused by their differences.

image

The Database.constructor parameter requires RawDatabase imageimage

Issue

(issue link here)

Lasting Changes (Technical)

(please list down: code changes/things that have wide-effect; new libraries/functions added that can be used by others; examples below)

Checklist

Please check directly on the box once each of these are done

Huy-DNA commented 2 months ago

@NQPhuc Looks good to me, pls help check again and approve nhe a :eyes: