988e901066
Añade campos params y output al frontmatter YAML de las 506 funciones del registry. Cada parámetro tiene descripción semántica (qué representa, unidades, rango típico) y cada función describe qué produce su output. Permite a agentes razonar sobre cadenas de composición (ej: prices → log_return → sharpe_ratio) sin leer código.
1.4 KiB
1.4 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| db_create_table | function | go | infra | 1.0.0 | impure | func DBCreateTable(db *sql.DB, table string, columns []string) error | Ejecuta CREATE TABLE IF NOT EXISTS con las definiciones de columnas dadas. Valida que el nombre de tabla sea un identificador SQL seguro. |
|
false | error_go_core |
|
|
nil si la tabla se creo exitosamente, error en caso contrario | false | functions/infra/db_create_table.go |
Ejemplo
err := DBCreateTable(db, "events", []string{
"id INTEGER PRIMARY KEY AUTOINCREMENT",
"name TEXT NOT NULL",
"ts INTEGER NOT NULL",
"payload TEXT",
})
Notas
columns son definiciones SQL completas incluyendo nombre, tipo y constraints. Usa CREATE TABLE IF NOT EXISTS para ser idempotente. Valida el nombre de tabla con regex ^[a-zA-Z_][a-zA-Z0-9_]*$ para prevenir SQL injection. Las definiciones de columna no se sanitizan — son responsabilidad del llamador.