You should log your values BEFORE you run the query to ensure they are not null
You should log your values BEFORE you run the query to ensure they are not null
SELECT * from items where id=(SELECT item_id FROM parts WHERE ? in (name, id))? to 0. Here it is in console:

strings to ints. value was '0' and not 0 and my 'Test_Entry' was 'test_entry' which is why nothing was workingwrangler d1 list. is there similar way to detect what local d1 dbs are available?wrangler source dev. Upon execution, this command would switch to the development environment. As a result, any subsequent command using wrangler would interact with local development databases and settings. This approach could simplify the development workflow by eliminating potential confusions related to various flags such as --persist, --local, and others.wrangler d1 execute <database-name> --local --file ./schema.sql command creates a db in the .wrangler folder. Is it possible to set a different location to put the db to?
D1_ERROR: Error: Internal error while starting up D1 storage caused object to be reset., doesn't load in the dashboard at all either, "Failed to reach database. Please try again later."7/2/23, 9:29 PM

export async function onRequestGet(context) {
const value = 0; // normally this is from the URL
var partialQuery = "SELECT item_id FROM ";
partialQuery+= 'categories';
partialQuery+=" WHERE ? in (name, id)";
var query = "SELECT * from items where id=("+partialQuery+")";
console.log(query);
var result = context.env.DB.
prepare(query).bind(value);
const res = await result.raw();
console.log("RESULT: "+res);
return new Response("");
}Unexpected token