How to run custom sql commands to database programatically I'm using MariaDB as database backend and I would like to use built in &quot;Sequences&quot; to get an integer number generator. I need to dinamically create sequences and get their values. Following this documentation I know the right sql commands to do it and I have tested it on MariaDB, but I haven't found a way to run this commands from Drupal 8 database connection object. I can only do selects, updates, inserts or deletes. How could I run this custom sql? I need it because I have to create custom sequences on submit some form.
I haven't found a way to run this commands from Drupal 8 database connection object. I can only do selects, updates, inserts or deletes

That's not true, you can also run arbitrary queries, e.g.:
\Drupal::database()-&gt;query('TRUNCATE TABLE foo');