Skip to content
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

Unique key search not working #44

Open
mk3008 opened this issue Jan 7, 2024 · 0 comments
Open

Unique key search not working #44

mk3008 opened this issue Jan 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mk3008
Copy link
Owner

mk3008 commented Jan 7, 2024

DbIndex attribute is recognized.

[DbIndex(isUnique: true, nameof(KeyName))]
[DbTable]
public class InterlinkDatasource
{
    [DbColumn("text")]
    public required string KeyName { get; set; }
}

Even if a unique constraint is added to the DbColumn attribute, it is not recognized.

[DbTable]
public class InterlinkDatasource
{
    [DbColumn("text", IsUniqueKey = true)]
    public required string KeyName { get; set; }
}

NOTE:
create table query

CREATE TABLE interlink.interlink_datasource (
	interlink_datasource_id bigserial NOT NULL,
	datasource_name text NOT NULL,
	description text NOT NULL,
	destination_id int8 NOT NULL,
	query text NOT NULL,
	key_name text NOT NULL,
	key_columns text NOT NULL,
	created_at timestamp NOT NULL,
	updated_at timestamp NOT NULL,
	lock_version int8 NOT NULL,
	CONSTRAINT interlink_datasource_pkey PRIMARY KEY (interlink_datasource_id)
);
CREATE UNIQUE INDEX i1_interlink_datasource ON interlink.interlink_datasource USING btree (key_name);
CREATE TABLE interlink.interlink_datasource (
	interlink_datasource_id bigserial NOT NULL,
	datasource_name text NOT NULL,
	description text NOT NULL,
	destination_id int8 NOT NULL,
	query text NOT NULL,
	key_name text NOT NULL,
	key_columns text NOT NULL,
	created_at timestamp NOT NULL,
	updated_at timestamp NOT NULL,
	lock_version int8 NOT NULL,
	CONSTRAINT interlink_datasource_key_name_key UNIQUE (key_name),
	CONSTRAINT interlink_datasource_pkey PRIMARY KEY (interlink_datasource_id)
);
@mk3008 mk3008 added the bug Something isn't working label Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant