Zod schemas for various database connection configurations.
// Source: https://github.com/marimo-team/marimo | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
/* Copyright 2026 Marimo. All rights reserved. */
import { z } from "zod";
import { FieldOptions } from "@/components/forms/options";
function passwordField() {
return z
.string()
.optional()
.describe(
FieldOptions.of({
label: "Password",
inputType: "password",
optionRegex: "(password|passwd|pgpassword|db.?pass(word)?)",
}),
);
}
function tokenField(label?: string, required?: boolean) {
let field: z.ZodString | z.ZodOptional<z.ZodString> = z.string();
field = required ? field.nonempty() : field.optional();
field = field.de
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key