[Plugin Development] How to add more conditions to kong.db.<tbl>:select()

I am new to develop kong plugins, suppose I have a database table created and I can already use kong.db.<tbl_name>:select() to select the record by ID. However, I’d like to add more customized WHERE clause like “deleted_at=null” or any other conditions to filter out my records, how should I do that? Thank you.

I’m curious if you’ve found an answer to your question. I’m trying to find a consumer object ID by its username value, but select() seems to only apply to the primary key which, in the case of consumers, is the Kong object ID; so sort of a chicken-and-egg scenario. :slightly_frowning_face:

You can use select_by_field_name to select the custom field instead of primary key. However, the value should be unique which means it can only return one record. That’s what I know so far.