mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-07-31 19:25:43 +08:00
chore: update connection creation modal
This commit is contained in:
@ -32,7 +32,8 @@ const CreateConnectionModal = (props: Props) => {
|
|||||||
const [isRequesting, setIsRequesting] = useState(false);
|
const [isRequesting, setIsRequesting] = useState(false);
|
||||||
const showDatabaseField = connection.engineType === Engine.PostgreSQL;
|
const showDatabaseField = connection.engineType === Engine.PostgreSQL;
|
||||||
const isEditing = editConnection !== undefined;
|
const isEditing = editConnection !== undefined;
|
||||||
const allowSave = connection.host !== "" && connection.username !== "";
|
const allowSave =
|
||||||
|
connection.host !== "" && connection.username !== "" && (connection.engineType === Engine.PostgreSQL ? connection.database : true);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (show) {
|
if (show) {
|
||||||
|
@ -18,8 +18,9 @@ export const getAssistantById = (id: Id) => {
|
|||||||
|
|
||||||
// getPromptOfAssistant define the special prompt for each assistant.
|
// getPromptOfAssistant define the special prompt for each assistant.
|
||||||
export const getPromptGeneratorOfAssistant = (assistant: User) => {
|
export const getPromptGeneratorOfAssistant = (assistant: User) => {
|
||||||
const basicPrompt = `Please follow the instructions to answer the questions.
|
const basicPrompt = `Please follow the instructions to answer the questions:
|
||||||
1. Set the language to the markdown code block for each code block. For example, \`SELECT * FROM table\` is SQL.
|
1. Set the language to the markdown code block for each code block. For example, \`SELECT * FROM table\` is SQL.
|
||||||
|
2. Please be careful to return only key information, and try not to make it too long.
|
||||||
`;
|
`;
|
||||||
if (assistant.id === "sql-assistant") {
|
if (assistant.id === "sql-assistant") {
|
||||||
return (schema: string) =>
|
return (schema: string) =>
|
||||||
|
Reference in New Issue
Block a user