buildInputQuery = ({ value, label, select, data, where, order }, id, initialData) => {
	if (!data || !(value || select)) return { hasQuery: false };

	let parentHasNoResolve = false;
	const q = new QueryBuilder().distinct();
	if (value) q.select({ value: sql`${value}` });
	if (label) {
		q.select({ label: sql`${label}` });
	} else {
		q.select({ label: sql`${value}` });
	}
	if (select) q.select(select);

	if (typeof data === 'string') {
		if (data.trim().match(/^[\w]+$/)) {
			// This is a table name
			q.from(data.trim());
		} else {
			// This is probably a subquery, or just broken
			q.from(sql(data.trim()));
		}
	} else if (Query.isQuery(data)) {
		// data is a QueryStore
		// use that as a subquery
		q.from(sql`(${data.text})`);
		parentHasNoResolve = data.opts.noResolve ?? false;
	} else {
		return { hasQuery: false };
	}

	if (where) {
		q.where(where);
	}

	if (order) {
		q.orderby(sql`${order}`);
		q.select({
			ordinal: sql`row_number() over (ORDER BY ${order})`
		});
	}

	const newQuery = buildQuery(q.toString(), id, initialData, { noResolve: parentHasNoResolve });
	// Don't make the component author bother with this, just provide the data
	newQuery.fetch();
	return {
		hasQuery: true,
		query: newQuery
	};
}
@param {QueryProps} opts
@param {string} id
@returns { { hasQuery: false } | { hasQuery: true, query: Query } }
@deprecated Prefer buildReactiveInputQuery