Until you enable the sql you can’t use sql.
You can have badges triggered by posts so they are awarded immediately.