Skip to content

Conversation

Mateusz-Switala
Copy link
Collaborator

@Mateusz-Switala Mateusz-Switala commented Sep 8, 2025

Currently, even the table has some primary key or foreign keys, we do not include these constraints when invoking get_table_info. The aim of this PR is to fix this:

CREATE TABLE public.patient (
	id BIGINT NOT NULL,
	sex TEXT,
	birthday DATE,
	description DATE,
	First Date DATE,
	admission TEXT,
	diagnosis TEXT,
	CONSTRAINT primary_key PRIMARY KEY (id),
	CONSTRAINT examination_id_fkey FOREIGN KEY (id) REFERENCES examination(id),
	CONSTRAINT laboratory_id_fkey FOREIGN KEY (id) REFERENCES laboratory(id)
	)

First 3 rows of table patient:

   id sex   birthday description First Date admission diagnosis
 2110   F 1934-02-13  1994-02-14 1993-02-10         +  RA susp.
11408   F 1937-05-02  1996-12-01 1973-01-01         +       PSS
12052   F 1956-04-14  1991-08-13       None         +       SLE

Before:

CREATE TABLE public.patient (
	id BIGINT NOT NULL,
	sex TEXT,
	birthday DATE,
	description DATE,
	First Date DATE,
	admission TEXT,
	diagnosis TEXT,
	)

First 3 rows of table patient:

      id sex    birthday description  First Date admission diagnosis
0   2110   F  1934-02-13  1994-02-14  1993-02-10         +  RA susp.
1  11408   F  1937-05-02  1996-12-01  1973-01-01         +       PSS
2  12052   F  1956-04-14  1991-08-13        None         +       SLE

@Mateusz-Switala Mateusz-Switala marked this pull request as ready for review September 9, 2025 07:35
@Mateusz-Switala Mateusz-Switala merged commit 47a4a4e into main Sep 10, 2025
15 checks passed
@Mateusz-Switala Mateusz-Switala deleted the fix-include-constraints-in-get-table-info branch September 10, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants