Using Python code in my plugin the function in sql language "GeomFromText(POINT(X Y))" gives the following error: "OperationalError: no such function: GeomFromText" Plugin functions in previous versions of QGIS.
First you need to load the spatialite extension. On linux:
expr = "SELECT load_extension('libspatialite');" c.execute(expr)
Now your insert should succeed. On Windows it;s similar, but with the full DLL name. Check this answer.