sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

Access to FOREIGN KEY info

Open delaneyj opened this issue 1 year ago • 1 comments

What do you want to change?

Hi, I've been writing a plugin and want to get access to foreign key info

CREATE TABLE articles(
    id INTEGER PRIMARY KEY,
    slug TEXT NOT NULL UNIQUE,
    title TEXT NOT NULL,
    description TEXT NOT NULL,
    body TEXT NOT NULL,
    created_at DATETIME NOT NULL,
    updated_at DATETIME NOT NULL,
    author_id INT NOT NULL,
    FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE
);

I don't see in the pb def how to get that fk info although it's part of the migrations. Please advise!

What database engines need to be changed?

SQLite

What programming language backends need to be changed?

Go

delaneyj avatar Oct 06 '24 18:10 delaneyj

I want to have the same for postgres

barp avatar Oct 10 '24 23:10 barp