Just opened a PR to fix this issue in QGIS v3 (on Windows). Remember that this is a dev version.
In the meantime, you could use this installer and adjust it by yourself (free software rocks!) after installation. You just need to change line 602 of
C:\\Program Files\\QGIS 2.99\\apps\\qgis-dev\\python\\qgis\\utils.py by:
Restart QGIS and now you'll be able to use
sqlite3 connections with
SpatiaLite support by using the following line from the QGIS Python Console or from your plugin:
con = qgis.utils.spatialite_connect("/path/to/your/spatialite_db.sqlite")
Now, you can create a new point layer in your database in this way (see the docs):
cur = con.cursor()
# Run next line if your DB was just created, it may take a while...
cur.execute("""CREATE TABLE test_geom (
id INTEGER NOT NULL
PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
measured_value DOUBLE NOT NULL);""")
cur.execute("""SELECT AddGeometryColumn('test_geom', 'the_geom',
4326, 'POINT', 'XY');""")
This little fix also makes db_manager able to open SpatiaLite databases.