Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asg017/sqlite-jiff
https://github.com/asg017/sqlite-jiff
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/asg017/sqlite-jiff
- Owner: asg017
- Created: 2024-07-22T22:36:08.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-22T22:36:30.000Z (4 months ago)
- Last Synced: 2024-10-20T08:06:02.465Z (17 days ago)
- Language: Rust
- Size: 1.95 KB
- Stars: 108
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-sqlite - SQLite Jiff - Date-time extension that supports timezones, complex durations, and daylight savings calculations. (Extensions)
README
# `sqlite-jiff`
Work-in-progress date-time SQLite extension that will support timezones, complex durations, and daylight savings calculations, based on the [`jiff` library](https://github.com/BurntSushi/jiff).
```sql
.load ./jiff0select jiff_duration(
'2024-11-02T01:59:59[America/Los_Angeles]',
'2024-11-02T02:00:01[America/New_York]',
'minutes'
) as result;
/*
┌──────────────────┐
│ result │
├──────────────────┤
│ 179.966666666667 │
└──────────────────┘
*/select jiff_duration(
'2024-11-03T01:59:59[America/Los_Angeles]',
'2024-11-03T02:00:01[America/New_York]',
'minutes'
) as result;
/*
┌──────────────────┐
│ result │
├──────────────────┤
│ 119.966666666667 │
└──────────────────┘
*/
```Note that in this example, `2024-11-03` at 2AM is Daylight Savings "fall back", which results in a 2hr difference instead of the "normal" 3hr difference.
Mostly a "this can work" project, not usable for most people.
If there's a feature or use-case that you think would be interesting in this extension, feel free to file an issue! I personally won't work much on this extension until `sqlite-vec` is out.