JedWalton / lucidify

File Q&A with Vector Databases along with a ChatUI and bespoke datasets. Golang, Nodejs, Python, Weaviate, OpenAI, Postgresql, Automated testing, Docker.
1 stars 0 forks source link

Ensure DocumentService has appropriate integration tests. #27

Open JedWalton opened 10 months ago

JedWalton commented 10 months ago

Something in the ballpark of -- Trigger function to update 'updated_at' CREATE OR REPLACE FUNCTION update_timestamp() RETURNS TRIGGER AS $$ BEGIN NEW.updated_at = CURRENT_TIMESTAMP; RETURN NEW; END; $$ LANGUAGE plpgsql;

-- Applying the trigger to the 'documents' table CREATE TRIGGER tr_update_timestamp BEFORE UPDATE ON documents FOR EACH ROW EXECUTE FUNCTION update_timestamp();

-- Similarly, for the 'document_chunks' table CREATE TRIGGER tr_chunks_update_timestamp BEFORE UPDATE ON document_chunks FOR EACH ROW EXECUTE FUNCTION update_timestamp();

and then work through integration tests to ensure full coverage.