Generate DBML from JS object

オープン
#514 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
32/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript, typescript

調査の方向性

dbml-core/src/model_structure/database.js と package index.js から始め、リンクされている ModelExporter のドキュメントを報告された TypeScript の import と比較します。サポートされている経路でモデルの公開 export、ドキュメント、またはその両方が必要かどうかを判断します。ユーザーが必要な Database 値を構築または import でき、Database と NormalizedDatabase の違いを理解できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

Hi,
First, thank you for this project and the libraries <3

I have an object representing my db and I'm looking to generate DBML from it.
Looking at https://dbml.dbdiagram.io/js-module/#class-modelexporter I see I can generate DBML using:

ModelExporter.export(database, 'postgres', false)

My issue is, I don't know how to generate a database value with Database type 😞

In the example it's build using the parser but I don't have DBML as input.

I saw the Database class is exported here: dbml-core/src/model_structure/database.js, and I tried to import it using:

import Database from "@dbml/core/types/model_structure/database";

But it gives me the error: Cannot find module '@dbml/core/types/model_structure/database' from 'src/dbml.ts'

And when I try:

import Database from "@dbml/core/model_structure/database";

I got the error: Cannot find module '@dbml/core/model_structure/database' or its corresponding type declarations.

Do you have any idea how I can configure TypeScript to match modules and type definitions or how I can create a Database class?
I think it would be nice to export the models in model_structure in the index.js, what do you think?
Also, I don't know the difference between a Database and a NormalizedDatabase, is there any explanation somewhere?

Thanks!

主要言語
JavaScript
スター
3.7k
フォーク
233
平均マージ
2日 4時間
マージ済み PR(30日)
23

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

holistics/dbml のほかの issue

holistics/dbml の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。