{"id":22902829,"url":"https://github.com/quackscience/duckdb-extension-tsid","last_synced_at":"2025-04-15T06:05:44.173Z","repository":{"id":268043680,"uuid":"900825734","full_name":"quackscience/duckdb-extension-tsid","owner":"quackscience","description":"TSID Extension for DuckDB ","archived":false,"fork":false,"pushed_at":"2024-12-09T16:16:36.000Z","size":35,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T06:05:39.751Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quackscience.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-09T14:40:58.000Z","updated_at":"2025-02-20T04:35:56.000Z","dependencies_parsed_at":"2024-12-14T02:32:18.436Z","dependency_job_id":null,"html_url":"https://github.com/quackscience/duckdb-extension-tsid","commit_stats":null,"previous_names":["quackscience/duckdb-extension-tsid"],"tags_count":0,"template":false,"template_full_name":"duckdb/extension-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quackscience%2Fduckdb-extension-tsid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quackscience%2Fduckdb-extension-tsid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quackscience%2Fduckdb-extension-tsid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quackscience%2Fduckdb-extension-tsid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quackscience","download_url":"https://codeload.github.com/quackscience/duckdb-extension-tsid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016624,"owners_count":21198833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["duckdb","duckdb-extension","rust","tsid"],"created_at":"2024-12-14T02:19:28.098Z","updated_at":"2025-04-15T06:05:44.167Z","avatar_url":"https://github.com/quackscience.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://github.com/user-attachments/assets/46a5c546-7e9b-42c7-87f4-bc8defe674e0\" width=250 /\u003e\n\n# DuckDB TSID Community Extension \nThis extension adds support for Time-Sorted Unique Identifiers (TSID)\n\n\u003e Experimental: USE AT YOUR OWN RISK!\n\n### 📦 Installation\n```sql\nINSTALL tsid FROM community;\nLOAD tsid;\n```\n\n### Usage\n\nGenerate a new TSID:\n```sql\n-- Generate a new time-sortable ID (accepts an optional seed string)\nD SELECT tsid();\n┌──────────────────────────────────┐\n│              tsid()              │\n│             varchar              │\n├──────────────────────────────────┤\n│ 675716e86985495e9cf575f0b9c4a8db │\n└──────────────────────────────────┘\n```\n\n### Working with Timestamps\n\nExtract the timestamp from a TSID:\n```sql\n-- Extract timestamp from a TSID\nD SELECT tsid_to_timestamp('675716e86985495e9cf575f0b9c4a8db');\n┌───────────────────────────────────────────────────────┐\n│ tsid_to_timestamp('675716e86985495e9cf575f0b9c4a8db') │\n│                       timestamp                       │\n├───────────────────────────────────────────────────────┤\n│ 2024-12-09 16:12:24.44259                             │\n└───────────────────────────────────────────────────────┘\n\n-- Verify TSID ordering\nD SELECT \n      a.id as id1,\n      b.id as id2,\n      tsid_to_timestamp(a.id) as ts1,\n      tsid_to_timestamp(b.id) as ts2\n  FROM \n      (SELECT tsid('a') as id FROM range(1)) a,\n      (SELECT tsid('b') as id FROM range(1)) b;\n┌──────────────────────────────────┬──────────────────────────────────┬────────────────────────────┬────────────────────────────┐\n│               id1                │               id2                │            ts1             │            ts2             │\n│             varchar              │             varchar              │         timestamp          │         timestamp          │\n├──────────────────────────────────┼──────────────────────────────────┼────────────────────────────┼────────────────────────────┤\n│ 6757176b9d4640b299be06ff79ed1373 │ 6757176b9d704dcf8a1dce8bb6da51bf │ 2024-12-09 16:14:35.659653 │ 2024-12-09 16:14:35.660354 │\n└──────────────────────────────────┴──────────────────────────────────┴────────────────────────────┴────────────────────────────┘\n```\n\n### Bulk Generation\n\nGenerate multiple TSIDs:\n```sql\n-- Generate 100 sequential unique TSIDs\nD SELECT tsid(random()::VARCHAR) as unique_id \n  FROM range(100);\n```\n\n### Features\n- Time-sortable: TSIDs are chronologically sortable by string comparison\n- Unique: Each ID is guaranteed to be unique\n- Timestamp extraction: Get the creation time of any TSID\n- High performance: Suitable for bulk generation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquackscience%2Fduckdb-extension-tsid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquackscience%2Fduckdb-extension-tsid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquackscience%2Fduckdb-extension-tsid/lists"}