mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-27 13:57:46 +00:00
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com> Co-authored-by: 谨欣 <echo.cmy@antgroup.com> Co-authored-by: 严志勇 <yanzhiyong@tiansuixiansheng.com> Co-authored-by: yanzhiyong <932374019@qq.com>
23 lines
561 B
TypeScript
23 lines
561 B
TypeScript
import { format } from 'sql-formatter';
|
|
|
|
/** Theme */
|
|
export const STORAGE_THEME_KEY = '__db_gpt_theme_key';
|
|
/** Language */
|
|
export const STORAGE_LANG_KEY = '__db_gpt_lng_key';
|
|
/** Init Message */
|
|
export const STORAGE_INIT_MESSAGE_KET = '__db_gpt_im_key';
|
|
/** Flow nodes */
|
|
export const FLOW_NODES_KEY = '__db_gpt_static_flow_nodes_key';
|
|
|
|
export function formatSql(sql: string, lang?: string) {
|
|
if (!sql) return '';
|
|
try {
|
|
return format(sql, { language: lang });
|
|
} catch {
|
|
return sql;
|
|
}
|
|
}
|
|
|
|
export * from './constants';
|
|
export * from './storage';
|