{"repo":"sphireinc/Hydra","free":true,"listed":false,"github":"https://github.com/sphireinc/Hydra","clone":"git clone https://github.com/sphireinc/Hydra.git","description":"A Go library that dynamically hydrates structs with data from multiple databases, offering flexibility and ease for database integration in software development.","language":"Go","stars":38,"topics":["database","hydration","orm"],"license":"MIT","category":"databases-storage","readme_excerpt":"Sphire Hydra Sphire Hydra is a Go library for hydrating Go structs from database rows using reflection and hydra tags. It supports: - MySQL - MariaDB - SQLite - PostgreSQL - CockroachDB - Microsoft SQL Server - Oracle [!WARNING] Hydra is still a small and evolving project. Treat the API as stabilizing rather than fully mature. Installation Quick start Contract Initialization Hydra requires an addressable struct pointer. Use: Do not rely on calling Init on a non-pointer struct value. Table name resolution Hydra resolves the table name in this order: 1. Hydratable.XTableNameOverride 2. HydraTableName() string on the struct 3. lowercase struct type name Example: Database handle types Hydra currently supports these handle types: - sql.DB - MySQL - MariaDB - SQLite - MSSQL - Oracle - pgx.Conn - PostgreSQL - CockroachDB Database routing is controlled by XDBTypeOverride. Examples: No rows If no row matches, Hydra returns: Hydra does not silently leaves the struct at zero values (earlier versions of Hydra did) Empty where clauses If hydration is attempted with an empty where map, Hydra returns: Identifier safety Hydra validates table names and column names before building SQL. Only simple identifiers are allowed: - letters - numbers - underscore - must not start with a number This intentionally rejects raw SQL fragments in identifiers. Tags Basic column mapping Primary key tags Use pk to mark the field used by HydrateByPrimaryKey(...) Lookup tags Use lookup for fields that should be ","default_branch":null,"files":null,"tree":[],"storefront":"/r/sphireinc","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/sphireinc/Hydra/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}