{"repo":"jetify-com/typeid-sql","free":true,"listed":false,"github":"https://github.com/jetify-com/typeid-sql","clone":"git clone https://github.com/jetify-com/typeid-sql.git","description":"SQL implementation TypeIDs: type-safe, K-sortable, and globally unique identifiers inspired by Stripe IDs","language":"PLpgSQL","stars":117,"topics":["typeid","uuid","uuidv7","guid","postgresql","sql"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"TypeID SQL A SQL implementation of TypeID using PostgreSQL. TypeIDs are a modern, type-safe , globally unique identifier based on the upcoming UUIDv7 standard. They provide a ton of nice properties that make them a great choice as the primary identifiers for your data in a database, APIs, and distributed systems. Read more about TypeIDs in their spec. This particular implementation demonstrates how to use TypeIDs in a postgres database. Installation To use typeids in your Postgres instance, you'll need define all the appropriate types and functions by running the SQL scripts in this repo. We recommend copying the SQL scripts into your migrations directory and using the migration tool of your choice. For example, Flyway, or Liquibase. Note that this repo is using Supabase as a way to easily start a Postgres instance for development and testing, but you do not need to use Supabase for this implementation to work – simply use the Postgres instance of your choice. Usage Once you've installed the TypeID types and functions in your Postgres instance, you have two options on how to encode TypeIDs in your database. 1. Text-based encoding This encoding is more inefficient than the alternative, but it's very straight-forward to understand, it's easy to debug by simply inspecting the contents of your tables, and it works well with other tools you might be using to inspect your database. To use it: + Declare your id column using the text type. + Use the typeid generate text function to g","default_branch":null,"files":null,"tree":[],"storefront":"/r/jetify-com","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/jetify-com/typeid-sql/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."}