['id', 'name', 'account_type_id', 'sector_id', 'public_location_id'], 'contacts' => ['id', 'account_id', 'contact_email_1'], ]); $parser = new DslParser(); $compiler = new DslCompiler($metadata); $ast = $parser->parse("accounts and contacts where accounts.account_type_id = 1"); $compiled = $compiler->compile($ast); $sql = (string) ($compiled['sql'] ?? ''); if (strpos($sql, 'picklist_') !== false) { fwrite(STDERR, "Did not expect implicit picklist joins in physical-schema projection\n"); exit(1); } if (strpos($sql, 's_accounts.`account_type_id` AS `accounts.account_type_id`') === false) { fwrite(STDERR, "Expected physical accounts.account_type_id projection\n"); exit(1); } if (strpos($sql, "COALESCE(s_accounts.`account_type_id`, '') = ?") === false) { fwrite(STDERR, "Expected predicate accounts.account_type_id to compile against physical column\n"); exit(1); } echo "DSL accounts physical-schema regression test passed\n";