Skip to content

satt-dots/pg18-uuidv7-example

Repository files navigation

PostgreSQL 18 UUIDv7 Example

使い方

前提

  • Taskfile がインストールされていること。
  • mise がインストールされていること。
  • Docker がインストールされていること。

クイックスタート

  1. ツールをセットアップする。

    task setup
  2. PostgreSQL サーバーを起動する。

    task pg:up
  3. DB マイグレーションを実行する。

    task dm:run
  4. サーバーに接続する。

    task pg:psql
  5. テーブル一覧を表示する。

    testdb=# \dt
                    List of tables
     Schema |       Name        | Type  |  Owner
    --------+-------------------+-------+----------
     public | schema_migrations | table | postgres
     public | users             | table | postgres
     (2 rows)
    
  6. ランダムな UUIDv7 の値を生成する。

    testdb=# select uuidv7();
                uuidv7
    --------------------------------------
    01995687-fd32-779d-a1f3-eb0cee7759d3
    (1 row)
    

参考

Releases

No releases published

Packages

 
 
 

Contributors

Languages