Skip to content

Commit 6ec7d5c

Browse files
author
Lucille Hua
authored
name and account change (#293)
## Summary ## How was it tested?
1 parent 16aef99 commit 6ec7d5c

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ⚠️ Submit PRs in our opensource monorepo instead ⚠️
22

33
This repository is automatically published from our opensource monorepo:
4-
https://github.com/jetpack-io/opensource
4+
https://github.com/jetify-com/opensource
55

66
If you want to contribute code changes to this project, please submit your
77
PR via the monorepo.

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ When contributing to this repository, please describe the change you wish to mak
55
Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.
66

77
## Opening a Pull Request
8-
This project is published as a standalone repo from our [opensource monorepo](https://github.com/jetpack-io/opensource).
8+
9+
This project is published as a standalone repo from our [opensource monorepo](https://github.com/jetify-com/opensource).
910
Pull requests should be sent to the monorepo instead, and they will automatically be published
1011
to this repo when merged.
1112

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
# TypeID SQL
2-
### A SQL implementation of [TypeID](https://github.com/jetpack-io/typeid) using PostgresSQL.
2+
3+
### A SQL implementation of [TypeID](https://github.com/jetify-com/typeid) using PostgresSQL.
4+
35
![License: Apache 2.0](https://img.shields.io/github/license/jetpack-io/typeid-sql)
46

57
TypeIDs are a modern, **type-safe**, globally unique identifier based on the upcoming
68
UUIDv7 standard. They provide a ton of nice properties that make them a great choice
79
as the primary identifiers for your data in a database, APIs, and distributed systems.
8-
Read more about TypeIDs in their [spec](https://github.com/jetpack-io/typeid).
10+
Read more about TypeIDs in their [spec](https://github.com/jetify-com/typeid).
911

1012
This particular implementation demonstrates how to use TypeIDs in a postgres database.
1113

1214
## Installation
15+
1316
To use typeids in your Postgres instance, you'll need define all the
1417
appropriate types and functions by running the SQL scripts in this repo.
1518

@@ -22,10 +25,12 @@ for development and testing, but you do **not** need to use Supabase for this
2225
implementation to work – simply use the Postgres instance of your choice.
2326

2427
## Usage
28+
2529
Once you've installed the TypeID types and functions in your Postgres instance,
2630
you can use it as follows.
2731

28-
To define a new type of typeid with a specific prefix use the `typeid_
32+
To define a new type of typeid with a specific prefix use the `typeid\_
33+
2934
```sql
3035
-- Define a `users` table that uses `user_id` as its primary key.
3136
-- We use the `typeid_generate` function to randomly generate a new typeid of the
@@ -50,7 +55,7 @@ You can use the typeid_generate_text function to generate a new typeid as a stri
5055
-- correct type for each user.
5156
-- You will need to manually add the check constraint to the column
5257
CREATE TABLE users (
53-
"id" text not null default typeid_generate_text('user') CHECK (typeid_check_text(id, 'user')),
58+
"id" text not null default typeid_generate_text('user') CHECK (typeid_check_text(id, 'user')),
5459
"name" text,
5560
"email" text
5661
);
@@ -96,6 +101,7 @@ WHERE id = 'user_01h455vb4pex5vsknk084sn02q';
96101
```
97102

98103
## (Optional) Operator overload
104+
99105
If you'd like to be able to do the following:
100106

101107
```sql
@@ -109,6 +115,7 @@ SELECT * FROM users u WHERE u.id = 'user_01h455vb4pex5vsknk084sn02q';
109115
Then you can add in [the operator overload function for typeids](https://github.com/search?q=repo%3Ajetpack-io%2Ftypeid-sql%20compare_type_id_equality&type=code):
110116

111117
## Future work (contributions welcome)
112-
- Include examples not just for Postgres, but for other databases like MySQL as well.
113-
- Consider rewriting this library as a postgres extension. It would make it possible to
114-
use the standard typeid string representation without the need of extra functions.
118+
119+
- Include examples not just for Postgres, but for other databases like MySQL as well.
120+
- Consider rewriting this library as a postgres extension. It would make it possible to
121+
use the standard typeid string representation without the need of extra functions.

0 commit comments

Comments
 (0)