You'll need to start off by including the library.
```
include Msf::Exploit::SQLi
```
Next we create our SQLi object:
```
sqli = create_sqli(dbms: MySQLi::Common, opts: sqli_opts) do |payload|
# Here is where we write in what to do each request using #{payload} as the spot to inject
end
```
`dbms` can be set to either `Common` if the DB isn't know, or one of the other databases and methods if it is known ahead of time such as `SQLitei::BooleanBasedBlind`
`sqli_opts` is a hash containing all of the options: https://github.com/red0xff/metasploit-framework/blob/master/lib/msf/core/exploit/sqli/common.rb#L10