e22c33ee6d
Mueve duckdb_open, clickhouse_open, postgres_open, matrix_* y keyring_token_store
del paquete monolitico functions/infra a subpaquetes propios
(functions/infra/{duckdb,clickhouse,postgres,matrix,keyring}). El paquete infra ya
no importa los drivers (go-duckdb, clickhouse-go, pgx, mautrix, go-keyring), por lo
que las apps que solo usan funciones ligeras (process, cron, http, sqlite) dejan de
arrastrarlos. Reduccion de binarios: dag_engine 72->10MB, registry_api 70->8.7MB,
services_api 70->9MB, call_monitor 68->6.6MB, sqlite_api 70->8.9MB.
Los IDs del registry se mantienen estables (domain: infra en frontmatter). Se
preservan los build tags goolm/libolm de matrix_crypto_init.
Tambien corrige TestSSEHandler: el test leia el body con un unico Read() que con
HTTP chunked solo capturaba el primer evento; ahora usa io.ReadAll hasta EOF.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1.6 KiB
1.6 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 | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| postgres_open | function | go | infra | 1.0.0 | impure | func PostgresOpen(host string, port int, user, password, dbname string, sslmode string) (*sql.DB, error) | Conecta a PostgreSQL construyendo el DSN desde parametros individuales. sslmode por defecto 'disable' si vacio. |
|
|
false | error_go_core |
|
|
conexion sql.DB abierta a PostgreSQL | false | functions/infra/postgres/postgres_open.go |
Ejemplo
db, err := PostgresOpen("localhost", 5432, "user", "secret", "mydb", "disable")
if err != nil {
log.Fatal(err)
}
defer DBClose(db)
rows, err := DBQuery(db, "SELECT id, name FROM users WHERE active = $1", true)
Notas
Usa el driver github.com/jackc/pgx/v5/stdlib registrado como "pgx". Construye DSN con los parametros separados para mayor legibilidad. Para produccion usar sslmode=require o sslmode=verify-full. Hace ping al abrir para verificar conectividad.