/datum/test
var/name = "test"
/proc/testing()
var/datum/test/T = new()
var/DBQuery/testQ = dbcon.NewQuery("SELECT * FROM things WHERE thing = [dbcon.Quote(T)]")
testQ.Execute()
dbcon.Quote(T) will return nothing.
The only reason i'm even reporting this is so you can go double check its not assuming it's a string valuetype and doing some out of bounds shit