{"version":3,"file":"show-databases.mjs","names":[],"sources":["../../src/actions/show-databases.ts"],"sourcesContent":["import type { AppAction } from \"@keystrokehq/keystroke/app\";\nimport { z } from \"zod\";\n\nimport { action } from \"../action\";\nimport { snowflake } from \"../app\";\n\nexport const SnowflakeShowDatabasesInput = z.object({\n  role: z.string().describe(\"Role to use when executing the statement.\").optional(),\n  limit: z.number().int().describe(\"Maximum number of rows to return. Cannot exceed 10000.\").optional(),\n  terse: z.boolean().default(false).describe(\"If true, returns only a subset of output columns (created_on, name, kind, database_name, schema_name).\").optional(),\n  history: z.boolean().default(false).describe(\"If true, includes dropped databases that are still within Time Travel retention period.\").optional(),\n  timeout: z.number().int().describe(\"Timeout in seconds for statement execution.\").optional(),\n  from_name: z.string().describe(\"Used with LIMIT for pagination. Returns results starting from databases whose names match this string.\").optional(),\n  warehouse: z.string().describe(\"Warehouse to use for the query (though SHOW DATABASES doesn't require a running warehouse).\").optional(),\n  starts_with: z.string().describe(\"Filters results by databases whose names start with this string. Case-sensitive.\").optional(),\n  like_pattern: z.string().describe(\"Filters results by database name using SQL wildcard pattern (% and _). Case-insensitive.\").optional(),\n});\nexport const SnowflakeShowDatabasesOutput = z.object({\n  data: z.array(z.array(z.union([z.string(), z.number().int(), z.number(), z.boolean()]).nullable())).describe(\"List of databases with their metadata. Each row contains database information like name, creation date, owner, etc.\"),\n  columns: z.array(z.string()).describe(\"Column names in the result set.\").nullable().optional(),\n}).passthrough();\n\nexport const snowflakeShowDatabases: AppAction<\n  typeof SnowflakeShowDatabasesInput,\n  typeof SnowflakeShowDatabasesOutput,\n  typeof snowflake.credential\n> = action(\"SNOWFLAKE_SHOW_DATABASES\", {\n  slug: \"snowflake-show-databases\",\n  name: \"Show Databases\",\n  description: \"Lists all databases for which you have access privileges. Shows database metadata including name, creation date, owner, retention time, and more. Can filter results and include dropped databases within Time Travel retention period.\",\n  input: SnowflakeShowDatabasesInput,\n  output: SnowflakeShowDatabasesOutput,\n});\n"],"mappings":";;;AAsBA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