feat(grid): show nullable indicator in query result headers
This commit is contained in:
5 files changed
+68
-3
No files matched your search
@@ -1,5 +1,12 @@
|
||||
import type { ColumnInfo } from "@/types/database";
|
||||
|
||||
export type DataGridColumnNullability = "nullable" | "required";
|
||||
|
||||
export function resolveDataGridColumnNullability(context: "results" | "table-data" | undefined, column: Pick<ColumnInfo, "is_nullable"> | undefined): DataGridColumnNullability | undefined {
|
||||
if (context !== "results" || !column) return undefined;
|
||||
return column.is_nullable ? "nullable" : "required";
|
||||
}
|
||||
|
||||
export function resolveDataGridColumnsByResultIndex(options: { resultColumns: readonly string[]; sourceColumns?: readonly (string | undefined)[]; tableColumns: readonly ColumnInfo[] }): Array<ColumnInfo | undefined> {
|
||||
const columnsByName = new Map<string, ColumnInfo>();
|
||||
for (const column of options.tableColumns) {
|
||||
|
||||
Reference in new issue
Block a user