SQL syntax for GPKG layer in virtual layer

I’m trying to create a virtual layer in QGIS for use in QField using SQL, but cannot work out what the syntax is to refer to a layer.

My gpkg is names “survey”.
My layer is named “treePt”.

I cannot get a simply SQL statement to work. I have tried the following layer names in the FROM statement
“survey - treePt”
‘survey - treePt’
survey - treePt
“treePt”
‘treePt’
treePt

All of which throw an error “Referenced table in query not found”


Imported from GitHub discussion by @Oisin-JK on 2023-07-11T15:44:16Z

Not sure virtual layers work in QField… Tried it today with errors at opening project in QField…


Imported from GitHub comment by @VxTedxV on 2023-07-11T16:37:03Z

Virtual layers do work in QField. I use them in my current shp file based project. I’m just trying to convert to gpkg.


Imported from GitHub comment by @Oisin-JK on 2023-07-11T18:22:28Z