Skip to content

DBQnA: Unified POST data format #2076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DBQnA/ui/react/src/components/DbConnect/DBConnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const DBConnect: React.FC = () => {
const [formData, setFormData] = useState({
user: 'postgres',
database: 'chinook',
host: '10.223.24.113',
host: '127.0.0.1',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean it assumes UI always run the same machine as postgres?
If UI and postgres on two different machines, can this work?
Should this be configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean it assumes UI always run the same machine as postgres? If UI and postgres on two different machines, can this work? Should this be configurable?

Thanks for your review. The 'host ip' can be configured by end user in UI. It's workable on two different machines.
This change just replace a hard coded IP with localhost. IMHO, it shouldn't be 10.223.24.113.

password: 'testpwd',
port: '5442',
});
Expand Down Expand Up @@ -42,7 +42,8 @@ const DBConnect: React.FC = () => {
e.preventDefault();
try {
let api_response: Record<string, any>;
api_response = await axios.post(`${TEXT_TO_SQL_URL}/postgres/health`, formData);
let unifiedConnData = {"conn_str":formData};
api_response = await axios.post(`${TEXT_TO_SQL_URL}/postgres/health`, unifiedConnData);

setSqlStatus(null);
setSqlError(null);
Expand Down