{"repo":"BarishNamazov/gsql","free":true,"listed":false,"github":"https://github.com/BarishNamazov/gsql","clone":"git clone https://github.com/BarishNamazov/gsql.git","description":"Write generic schemas with parametric polymorphism for SQL databases","language":"TypeScript","stars":11,"topics":["compiler","database","generics","postgres","schema","sql"],"license":"MIT","category":"databases-storage","readme_excerpt":"GSQL - Generic SQL Parametric polymorphism for SQL schemas GSQL is a domain-specific language that brings the power of generics/templates to database schemas. Define common patterns once, instantiate them freely. Read the background story: Parametric Polymorphism for SQL The Problem When building relational databases, you often need to duplicate table structures with minor variations. For example, in a learning management system, you might need announcements for courses, lessons, and exams—the same pattern repeated three times. Current solutions force you to choose between: - Separate tables - Violates DRY principles, leads to maintenance nightmares - Polymorphic associations - Sacrifices foreign key integrity and type safety GSQL solves this by letting you define reusable schema templates (concepts) that compile to PostgreSQL with proper foreign key constraints. Quick Example Here is the \"LMS Dilemma\" (Courses, Lessons, Exams) solved with GSQL. We define an Announcing pattern once and apply it to three different tables, generating strictly typed foreign keys for each. This generates three announcement tables with proper foreign keys: Key Features - Schemas : A table definition with columns, constraints, indexes, triggers - Concepts : Generic schema templates with type parameters - Mixins : Compose reusable schema fragments - Template variables : Automatic field name expansion - Sibling references : Multiple schemas within one concept can reference each other - Per-instance i","default_branch":null,"files":null,"tree":[],"storefront":"/r/BarishNamazov","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/BarishNamazov/gsql/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."}