Your Question

How can I make my custom clause work globally with gorm ? Some thing like this

db.Using("white_list").Where("user.id != white_list.user_id").Delete(&User{})
// DELETE FROM users USING white_list WHERE user.id != white_list.user_id;

The document you expected this should be explained

https://gorm.io/docs/sql_builder.html But now show it very clear how I could register my custom clause globally

Expected answer

Please ignore the detail of my query. I want to how to make custom clause work easily

Comment From: jinzhu

You can use add the condition to the global DB? also refer: https://gorm.io/docs/method_chaining.html

Comment From: jinzhu

Or you can write a plugin https://gorm.io/docs/write_plugins.html