Fix go to pinned message ambiguous sql column

This commit is contained in:
Jamie
2026-01-22 12:07:35 -08:00
committed by GitHub
parent a6b5894443
commit 721035b821
3 changed files with 58 additions and 46 deletions

View File

@@ -77,7 +77,7 @@ import type {
RemoteMegaphoneId,
RemoteMegaphoneType,
} from '../types/Megaphone.std.js';
import { QueryFragment, sqlJoin } from './util.std.js';
import { sqlFragment, sqlId, sqlJoin } from './util.std.js';
export type ReadableDB = Database & { __readable_db: never };
export type WritableDB = ReadableDB & { __writable_db: never };
@@ -194,12 +194,12 @@ export const MESSAGE_COLUMNS = [
...MESSAGE_NON_PRIMARY_KEY_COLUMNS,
] as const;
export const MESSAGE_COLUMNS_FRAGMENTS = MESSAGE_COLUMNS.map(
column => new QueryFragment(column, [])
export const MESSAGE_COLUMNS_FRAGMENT = sqlJoin(
MESSAGE_COLUMNS.map(column => {
return sqlFragment`messages.${sqlId(column)}`;
})
);
export const MESSAGE_COLUMNS_SELECT = sqlJoin(MESSAGE_COLUMNS_FRAGMENTS);
export type MessageTypeUnhydrated = {
json: string;