mirror of
https://github.com/chartdb/chartdb.git
synced 2025-11-04 14:03:15 +00:00
Compare commits
4 Commits
v1.8.0
...
jf/wrong_i
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
595e3db0b3 | ||
|
|
ab89bad6d5 | ||
|
|
deb218423f | ||
|
|
48342471ac |
@@ -7,6 +7,7 @@ import type { ExportImageDialogProps } from '@/dialogs/export-image-dialog/expor
|
|||||||
import type { ExportDiagramDialogProps } from '@/dialogs/export-diagram-dialog/export-diagram-dialog';
|
import type { ExportDiagramDialogProps } from '@/dialogs/export-diagram-dialog/export-diagram-dialog';
|
||||||
import type { ImportDiagramDialogProps } from '@/dialogs/import-diagram-dialog/import-diagram-dialog';
|
import type { ImportDiagramDialogProps } from '@/dialogs/import-diagram-dialog/import-diagram-dialog';
|
||||||
import type { CreateRelationshipDialogProps } from '@/dialogs/create-relationship-dialog/create-relationship-dialog';
|
import type { CreateRelationshipDialogProps } from '@/dialogs/create-relationship-dialog/create-relationship-dialog';
|
||||||
|
import type { ImportDBMLDialogProps } from '@/dialogs/import-dbml-dialog/import-dbml-dialog';
|
||||||
|
|
||||||
export interface DialogContext {
|
export interface DialogContext {
|
||||||
// Create diagram dialog
|
// Create diagram dialog
|
||||||
@@ -66,7 +67,9 @@ export interface DialogContext {
|
|||||||
closeImportDiagramDialog: () => void;
|
closeImportDiagramDialog: () => void;
|
||||||
|
|
||||||
// Import DBML dialog
|
// Import DBML dialog
|
||||||
openImportDBMLDialog: () => void;
|
openImportDBMLDialog: (
|
||||||
|
params?: Omit<ImportDBMLDialogProps, 'dialog'>
|
||||||
|
) => void;
|
||||||
closeImportDBMLDialog: () => void;
|
closeImportDBMLDialog: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import { ExportImageDialog } from '@/dialogs/export-image-dialog/export-image-di
|
|||||||
import { ExportDiagramDialog } from '@/dialogs/export-diagram-dialog/export-diagram-dialog';
|
import { ExportDiagramDialog } from '@/dialogs/export-diagram-dialog/export-diagram-dialog';
|
||||||
import { ImportDiagramDialog } from '@/dialogs/import-diagram-dialog/import-diagram-dialog';
|
import { ImportDiagramDialog } from '@/dialogs/import-diagram-dialog/import-diagram-dialog';
|
||||||
import { BuckleDialog } from '@/dialogs/buckle-dialog/buckle-dialog';
|
import { BuckleDialog } from '@/dialogs/buckle-dialog/buckle-dialog';
|
||||||
|
import type { ImportDBMLDialogProps } from '@/dialogs/import-dbml-dialog/import-dbml-dialog';
|
||||||
import { ImportDBMLDialog } from '@/dialogs/import-dbml-dialog/import-dbml-dialog';
|
import { ImportDBMLDialog } from '@/dialogs/import-dbml-dialog/import-dbml-dialog';
|
||||||
|
|
||||||
export const DialogProvider: React.FC<React.PropsWithChildren> = ({
|
export const DialogProvider: React.FC<React.PropsWithChildren> = ({
|
||||||
@@ -111,6 +112,8 @@ export const DialogProvider: React.FC<React.PropsWithChildren> = ({
|
|||||||
|
|
||||||
// Import DBML dialog
|
// Import DBML dialog
|
||||||
const [openImportDBMLDialog, setOpenImportDBMLDialog] = useState(false);
|
const [openImportDBMLDialog, setOpenImportDBMLDialog] = useState(false);
|
||||||
|
const [importDBMLDialogParams, setImportDBMLDialogParams] =
|
||||||
|
useState<Omit<ImportDBMLDialogProps, 'dialog'>>();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<dialogContext.Provider
|
<dialogContext.Provider
|
||||||
@@ -142,7 +145,10 @@ export const DialogProvider: React.FC<React.PropsWithChildren> = ({
|
|||||||
openImportDiagramDialog: () => setOpenImportDiagramDialog(true),
|
openImportDiagramDialog: () => setOpenImportDiagramDialog(true),
|
||||||
closeImportDiagramDialog: () =>
|
closeImportDiagramDialog: () =>
|
||||||
setOpenImportDiagramDialog(false),
|
setOpenImportDiagramDialog(false),
|
||||||
openImportDBMLDialog: () => setOpenImportDBMLDialog(true),
|
openImportDBMLDialog: (params) => {
|
||||||
|
setImportDBMLDialogParams(params);
|
||||||
|
setOpenImportDBMLDialog(true);
|
||||||
|
},
|
||||||
closeImportDBMLDialog: () => setOpenImportDBMLDialog(false),
|
closeImportDBMLDialog: () => setOpenImportDBMLDialog(false),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -173,7 +179,10 @@ export const DialogProvider: React.FC<React.PropsWithChildren> = ({
|
|||||||
<ExportDiagramDialog dialog={{ open: openExportDiagramDialog }} />
|
<ExportDiagramDialog dialog={{ open: openExportDiagramDialog }} />
|
||||||
<ImportDiagramDialog dialog={{ open: openImportDiagramDialog }} />
|
<ImportDiagramDialog dialog={{ open: openImportDiagramDialog }} />
|
||||||
<BuckleDialog dialog={{ open: openBuckleDialog }} />
|
<BuckleDialog dialog={{ open: openBuckleDialog }} />
|
||||||
<ImportDBMLDialog dialog={{ open: openImportDBMLDialog }} />
|
<ImportDBMLDialog
|
||||||
|
dialog={{ open: openImportDBMLDialog }}
|
||||||
|
{...importDBMLDialogParams}
|
||||||
|
/>
|
||||||
</dialogContext.Provider>
|
</dialogContext.Provider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ export const ImportDatabase: React.FC<ImportDatabaseProps> = ({
|
|||||||
|
|
||||||
const [showSSMSInfoDialog, setShowSSMSInfoDialog] = useState(false);
|
const [showSSMSInfoDialog, setShowSSMSInfoDialog] = useState(false);
|
||||||
|
|
||||||
|
const helpButtonRef = React.useRef<HTMLButtonElement>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const loadScripts = async () => {
|
const loadScripts = async () => {
|
||||||
const { importMetadataScripts } = await import(
|
const { importMetadataScripts } = await import(
|
||||||
@@ -134,6 +136,11 @@ export const ImportDatabase: React.FC<ImportDatabaseProps> = ({
|
|||||||
if (inputValue.length === 65535) {
|
if (inputValue.length === 65535) {
|
||||||
setShowSSMSInfoDialog(true);
|
setShowSSMSInfoDialog(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show instructions when input contains "WITH fk_info as"
|
||||||
|
if (inputValue.toLowerCase().includes('with fk_info as')) {
|
||||||
|
helpButtonRef.current?.click();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[setScriptResult]
|
[setScriptResult]
|
||||||
);
|
);
|
||||||
@@ -398,7 +405,11 @@ export const ImportDatabase: React.FC<ImportDatabaseProps> = ({
|
|||||||
)}
|
)}
|
||||||
{isDesktop ? (
|
{isDesktop ? (
|
||||||
<ZoomableImage src="/load-new-db-instructions.gif">
|
<ZoomableImage src="/load-new-db-instructions.gif">
|
||||||
<Button type="button" variant="link">
|
<Button
|
||||||
|
type="button"
|
||||||
|
variant="link"
|
||||||
|
ref={helpButtonRef}
|
||||||
|
>
|
||||||
{t(
|
{t(
|
||||||
'new_diagram_dialog.import_database.instructions_link'
|
'new_diagram_dialog.import_database.instructions_link'
|
||||||
)}
|
)}
|
||||||
@@ -450,7 +461,11 @@ export const ImportDatabase: React.FC<ImportDatabaseProps> = ({
|
|||||||
|
|
||||||
{!isDesktop ? (
|
{!isDesktop ? (
|
||||||
<ZoomableImage src="/load-new-db-instructions.gif">
|
<ZoomableImage src="/load-new-db-instructions.gif">
|
||||||
<Button type="button" variant="link">
|
<Button
|
||||||
|
type="button"
|
||||||
|
variant="link"
|
||||||
|
ref={helpButtonRef}
|
||||||
|
>
|
||||||
{t(
|
{t(
|
||||||
'new_diagram_dialog.import_database.instructions_link'
|
'new_diagram_dialog.import_database.instructions_link'
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export const CreateDiagramDialog: React.FC<CreateDiagramDialogProps> = ({
|
|||||||
const [databaseType, setDatabaseType] = useState<DatabaseType>(
|
const [databaseType, setDatabaseType] = useState<DatabaseType>(
|
||||||
DatabaseType.GENERIC
|
DatabaseType.GENERIC
|
||||||
);
|
);
|
||||||
const { closeCreateDiagramDialog } = useDialog();
|
const { closeCreateDiagramDialog, openImportDBMLDialog } = useDialog();
|
||||||
const { updateConfig } = useConfig();
|
const { updateConfig } = useConfig();
|
||||||
const [scriptResult, setScriptResult] = useState('');
|
const [scriptResult, setScriptResult] = useState('');
|
||||||
const [databaseEdition, setDatabaseEdition] = useState<
|
const [databaseEdition, setDatabaseEdition] = useState<
|
||||||
@@ -104,6 +104,10 @@ export const CreateDiagramDialog: React.FC<CreateDiagramDialogProps> = ({
|
|||||||
await updateConfig({ defaultDiagramId: diagram.id });
|
await updateConfig({ defaultDiagramId: diagram.id });
|
||||||
closeCreateDiagramDialog();
|
closeCreateDiagramDialog();
|
||||||
navigate(`/diagrams/${diagram.id}`);
|
navigate(`/diagrams/${diagram.id}`);
|
||||||
|
setTimeout(
|
||||||
|
() => openImportDBMLDialog({ withCreateEmptyDiagram: true }),
|
||||||
|
700
|
||||||
|
);
|
||||||
}, [
|
}, [
|
||||||
databaseType,
|
databaseType,
|
||||||
addDiagram,
|
addDiagram,
|
||||||
@@ -112,6 +116,7 @@ export const CreateDiagramDialog: React.FC<CreateDiagramDialogProps> = ({
|
|||||||
navigate,
|
navigate,
|
||||||
updateConfig,
|
updateConfig,
|
||||||
diagramNumber,
|
diagramNumber,
|
||||||
|
openImportDBMLDialog,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -71,10 +71,13 @@ function parseDBMLError(error: unknown): DBMLError | null {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ImportDBMLDialogProps extends BaseDialogProps {}
|
export interface ImportDBMLDialogProps extends BaseDialogProps {
|
||||||
|
withCreateEmptyDiagram?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export const ImportDBMLDialog: React.FC<ImportDBMLDialogProps> = ({
|
export const ImportDBMLDialog: React.FC<ImportDBMLDialogProps> = ({
|
||||||
dialog,
|
dialog,
|
||||||
|
withCreateEmptyDiagram,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const initialDBML = `// Use DBML to define your database structure
|
const initialDBML = `// Use DBML to define your database structure
|
||||||
@@ -331,7 +334,11 @@ Ref: comments.user_id > users.id // Each comment is written by one user`;
|
|||||||
showClose
|
showClose
|
||||||
>
|
>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>{t('import_dbml_dialog.title')}</DialogTitle>
|
<DialogTitle>
|
||||||
|
{withCreateEmptyDiagram
|
||||||
|
? t('import_dbml_dialog.example_title')
|
||||||
|
: t('import_dbml_dialog.title')}
|
||||||
|
</DialogTitle>
|
||||||
<DialogDescription>
|
<DialogDescription>
|
||||||
{t('import_dbml_dialog.description')}
|
{t('import_dbml_dialog.description')}
|
||||||
</DialogDescription>
|
</DialogDescription>
|
||||||
@@ -369,7 +376,9 @@ Ref: comments.user_id > users.id // Each comment is written by one user`;
|
|||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
<DialogClose asChild>
|
<DialogClose asChild>
|
||||||
<Button variant="secondary">
|
<Button variant="secondary">
|
||||||
{t('import_dbml_dialog.cancel')}
|
{withCreateEmptyDiagram
|
||||||
|
? t('import_dbml_dialog.skip_and_empty')
|
||||||
|
: t('import_dbml_dialog.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogClose>
|
</DialogClose>
|
||||||
{errorMessage ? (
|
{errorMessage ? (
|
||||||
@@ -389,7 +398,9 @@ Ref: comments.user_id > users.id // Each comment is written by one user`;
|
|||||||
onClick={handleImport}
|
onClick={handleImport}
|
||||||
disabled={!dbmlContent.trim() || !!errorMessage}
|
disabled={!dbmlContent.trim() || !!errorMessage}
|
||||||
>
|
>
|
||||||
{t('import_dbml_dialog.import')}
|
{withCreateEmptyDiagram
|
||||||
|
? t('import_dbml_dialog.show_example')
|
||||||
|
: t('import_dbml_dialog.import')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</DialogFooter>
|
</DialogFooter>
|
||||||
|
|||||||
@@ -378,9 +378,12 @@ export const ar: LanguageTranslation = {
|
|||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -381,10 +381,13 @@ export const bn: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -384,10 +384,13 @@ export const de: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -376,10 +376,13 @@ export const en = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error importing DBML',
|
title: 'Error importing DBML',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -383,10 +383,13 @@ export const es: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -30,9 +30,8 @@ export const fr: LanguageTranslation = {
|
|||||||
theme: 'Thème',
|
theme: 'Thème',
|
||||||
show_dependencies: 'Afficher les Dépendances',
|
show_dependencies: 'Afficher les Dépendances',
|
||||||
hide_dependencies: 'Masquer les Dépendances',
|
hide_dependencies: 'Masquer les Dépendances',
|
||||||
// TODO: Translate
|
show_minimap: 'Afficher la Mini Carte',
|
||||||
show_minimap: 'Show Mini Map',
|
hide_minimap: 'Masquer la Mini Carte',
|
||||||
hide_minimap: 'Hide Mini Map',
|
|
||||||
},
|
},
|
||||||
share: {
|
share: {
|
||||||
share: 'Partage',
|
share: 'Partage',
|
||||||
@@ -101,9 +100,8 @@ export const fr: LanguageTranslation = {
|
|||||||
clear: 'Effacer',
|
clear: 'Effacer',
|
||||||
show_more: 'Afficher Plus',
|
show_more: 'Afficher Plus',
|
||||||
show_less: 'Afficher Moins',
|
show_less: 'Afficher Moins',
|
||||||
// TODO: Translate
|
copy_to_clipboard: 'Copier dans le presse-papiers',
|
||||||
copy_to_clipboard: 'Copy to Clipboard',
|
copied: 'Copié !',
|
||||||
copied: 'Copied!',
|
|
||||||
|
|
||||||
side_panel: {
|
side_panel: {
|
||||||
schema: 'Schéma:',
|
schema: 'Schéma:',
|
||||||
@@ -116,12 +114,11 @@ export const fr: LanguageTranslation = {
|
|||||||
add_table: 'Ajouter une Table',
|
add_table: 'Ajouter une Table',
|
||||||
filter: 'Filtrer',
|
filter: 'Filtrer',
|
||||||
collapse: 'Réduire Tout',
|
collapse: 'Réduire Tout',
|
||||||
// TODO: Translate
|
clear: 'Effacer le Filtre',
|
||||||
clear: 'Clear Filter',
|
no_results:
|
||||||
no_results: 'No tables found matching your filter.',
|
'Aucune table trouvée correspondant à votre filtre.',
|
||||||
// TODO: Translate
|
show_list: 'Afficher la Liste des Tableaux',
|
||||||
show_list: 'Show Table List',
|
show_dbml: "Afficher l'éditeur DBML",
|
||||||
show_dbml: 'Show DBML Editor',
|
|
||||||
|
|
||||||
table: {
|
table: {
|
||||||
fields: 'Champs',
|
fields: 'Champs',
|
||||||
@@ -153,7 +150,7 @@ export const fr: LanguageTranslation = {
|
|||||||
title: 'Actions de la Table',
|
title: 'Actions de la Table',
|
||||||
add_field: 'Ajouter un Champ',
|
add_field: 'Ajouter un Champ',
|
||||||
add_index: 'Ajouter un Index',
|
add_index: 'Ajouter un Index',
|
||||||
duplicate_table: 'Duplicate Table', // TODO: Translate
|
duplicate_table: 'Tableau dupliqué',
|
||||||
delete_table: 'Supprimer la Table',
|
delete_table: 'Supprimer la Table',
|
||||||
change_schema: 'Changer le Schéma',
|
change_schema: 'Changer le Schéma',
|
||||||
},
|
},
|
||||||
@@ -236,14 +233,12 @@ export const fr: LanguageTranslation = {
|
|||||||
step_2: 'Si vous utilisez "Résultats en Grille", changez le nombre maximum de caractères récupérés pour les données non-XML (définir à 9999999).',
|
step_2: 'Si vous utilisez "Résultats en Grille", changez le nombre maximum de caractères récupérés pour les données non-XML (définir à 9999999).',
|
||||||
},
|
},
|
||||||
instructions_link: "Besoin d'aide ? Regardez comment",
|
instructions_link: "Besoin d'aide ? Regardez comment",
|
||||||
// TODO: Translate
|
check_script_result: 'Vérifier le résultat du Script',
|
||||||
check_script_result: 'Check Script Result',
|
|
||||||
},
|
},
|
||||||
|
|
||||||
cancel: 'Annuler',
|
cancel: 'Annuler',
|
||||||
back: 'Retour',
|
back: 'Retour',
|
||||||
// TODO: Translate
|
import_from_file: "Importer à partir d'un fichier",
|
||||||
import_from_file: 'Import from File',
|
|
||||||
empty_diagram: 'Diagramme vide',
|
empty_diagram: 'Diagramme vide',
|
||||||
continue: 'Continuer',
|
continue: 'Continuer',
|
||||||
import: 'Importer',
|
import: 'Importer',
|
||||||
@@ -358,40 +353,42 @@ export const fr: LanguageTranslation = {
|
|||||||
cancel: 'Annuler',
|
cancel: 'Annuler',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// TODO: Translate
|
|
||||||
export_diagram_dialog: {
|
export_diagram_dialog: {
|
||||||
title: 'Export Diagram',
|
title: 'Exporter le Diagramme',
|
||||||
description: 'Choose the format for export:',
|
description: "Sélectionner le format d'exportation :",
|
||||||
format_json: 'JSON',
|
format_json: 'JSON',
|
||||||
cancel: 'Cancel',
|
cancel: 'Annuler',
|
||||||
export: 'Export',
|
export: 'Exporter',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error exporting diagram',
|
title: "Erreur lors de l'exportation du diagramme",
|
||||||
description:
|
description:
|
||||||
'Something went wrong. Need help? chartdb.io@gmail.com',
|
"Une erreur s'est produite. Besoin d'aide ? chartdb.io@gmail.com",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// TODO: Translate
|
|
||||||
import_diagram_dialog: {
|
import_diagram_dialog: {
|
||||||
title: 'Import Diagram',
|
title: 'Importer un diagramme',
|
||||||
description: 'Paste the diagram JSON below:',
|
description: 'Coller le diagramme au format JSON ci-dessous :',
|
||||||
cancel: 'Cancel',
|
cancel: 'Annuler',
|
||||||
import: 'Import',
|
import: 'Exporter',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error importing diagram',
|
title: "Erreur lors de l'exportation du diagramme",
|
||||||
description:
|
description:
|
||||||
'The diagram JSON is invalid. Please check the JSON and try again. Need help? chartdb.io@gmail.com',
|
"Le diagramme JSON n'est pas valide. Veuillez vérifier le JSON et réessayer. Besoin d'aide ? chartdb.io@gmail.com",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// TODO: Translate
|
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: "Exemple d'importation DBML",
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description:
|
||||||
import: 'Import',
|
'Importer un schéma de base de données à partir du format DBML.',
|
||||||
cancel: 'Cancel',
|
import: 'Importer',
|
||||||
|
cancel: 'Annuler',
|
||||||
|
skip_and_empty: 'Passer et vider',
|
||||||
|
show_example: 'Afficher un exemple',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Erreur',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description:
|
||||||
|
"Erreur d'analyse du DBML. Veuillez vérifier la syntaxe.",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
relationship_type: {
|
relationship_type: {
|
||||||
@@ -408,13 +405,13 @@ export const fr: LanguageTranslation = {
|
|||||||
|
|
||||||
table_node_context_menu: {
|
table_node_context_menu: {
|
||||||
edit_table: 'Éditer la Table',
|
edit_table: 'Éditer la Table',
|
||||||
duplicate_table: 'Duplicate Table', // TODO: Translate
|
duplicate_table: 'Tableau Dupliqué',
|
||||||
delete_table: 'Supprimer la Table',
|
delete_table: 'Supprimer la Table',
|
||||||
add_relationship: 'Add Relationship', // TODO: Translate
|
add_relationship: 'Ajouter une Relation',
|
||||||
},
|
},
|
||||||
|
|
||||||
// TODO: Add translations
|
snap_to_grid_tooltip:
|
||||||
snap_to_grid_tooltip: 'Snap to Grid (Hold {{key}})',
|
'Aligner sur la grille (maintenir la touche {{key}})',
|
||||||
|
|
||||||
tool_tips: {
|
tool_tips: {
|
||||||
double_click_to_edit: 'Double-cliquez pour modifier',
|
double_click_to_edit: 'Double-cliquez pour modifier',
|
||||||
|
|||||||
@@ -381,10 +381,13 @@ export const gu: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -385,10 +385,13 @@ export const hi: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -379,10 +379,13 @@ export const id_ID: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -388,10 +388,13 @@ export const ja: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -377,10 +377,13 @@ export const ko_KR: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -389,10 +389,13 @@ export const mr: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -382,10 +382,13 @@ export const ne: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -382,10 +382,13 @@ export const pt_BR: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -378,10 +378,13 @@ export const ru: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -385,10 +385,13 @@ export const te: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -372,10 +372,13 @@ export const tr: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -377,10 +377,13 @@ export const uk: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -378,10 +378,13 @@ export const vi: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -374,10 +374,13 @@ export const zh_CN: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -373,10 +373,13 @@ export const zh_TW: LanguageTranslation = {
|
|||||||
},
|
},
|
||||||
// TODO: Translate
|
// TODO: Translate
|
||||||
import_dbml_dialog: {
|
import_dbml_dialog: {
|
||||||
|
example_title: 'Import Example DBML',
|
||||||
title: 'Import DBML',
|
title: 'Import DBML',
|
||||||
description: 'Import a database schema from DBML format.',
|
description: 'Import a database schema from DBML format.',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
|
skip_and_empty: 'Skip & Empty',
|
||||||
|
show_example: 'Show Example',
|
||||||
error: {
|
error: {
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'Failed to parse DBML. Please check the syntax.',
|
description: 'Failed to parse DBML. Please check the syntax.',
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ export const sqliteDataTypes: readonly DataType[] = [
|
|||||||
// Blob Type
|
// Blob Type
|
||||||
{ name: 'blob', id: 'blob' },
|
{ name: 'blob', id: 'blob' },
|
||||||
|
|
||||||
|
// Blob Type
|
||||||
|
{ name: 'json', id: 'json' },
|
||||||
|
|
||||||
// Date/Time Types (SQLite uses TEXT, REAL, or INTEGER types for dates and times)
|
// Date/Time Types (SQLite uses TEXT, REAL, or INTEGER types for dates and times)
|
||||||
{ name: 'date', id: 'date' },
|
{ name: 'date', id: 'date' },
|
||||||
{ name: 'datetime', id: 'datetime' },
|
{ name: 'datetime', id: 'datetime' },
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export const sqliteQuery = `WITH fk_info AS (
|
|||||||
ELSE LOWER(p.type)
|
ELSE LOWER(p.type)
|
||||||
END,
|
END,
|
||||||
'ordinal_position', p.cid,
|
'ordinal_position', p.cid,
|
||||||
'nullable', (CASE WHEN p."notnull" = 0 THEN 'true' ELSE 'false' END),
|
'nullable', (CASE WHEN p."notnull" = 0 THEN true ELSE false END),
|
||||||
'collation', '',
|
'collation', '',
|
||||||
'character_maximum_length',
|
'character_maximum_length',
|
||||||
CASE
|
CASE
|
||||||
|
|||||||
Reference in New Issue
Block a user