Sqlean.py

Latest version: v3.47.0

Safety actively analyzes 688323 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 12

3.45.1

3.45.0

- Updated to SQLite [3.45.0](https://sqlite.org/releaselog/3_45_0.html).
- `sqlean.py` is now versioned according to SQLite.

0.27.1

This release adds the [time](https://github.com/nalgeon/sqlean/blob/main/docs/time.md) extension to the single-file `sqlean` bundle.

0.27.0

This release introduces the new [time](https://github.com/nalgeon/sqlean/blob/main/docs/time.md) extension — a structured, high-precision date/time API with a rich set of functions from working with Unix time to time comparison and arithmetic to truncation and rounding.

Creating time values:

text
time_now()
time_date(year, month, day[, hour, min, sec[, nsec[, offset_sec]]])


Extracting time fields:

text
time_get_year(t)
time_get_month(t)
time_get_day(t)
time_get_hour(t)
time_get_minute(t)
time_get_second(t)
time_get_nano(t)
time_get_weekday(t)
time_get_yearday(t)
time_get_isoyear(t)
time_get_isoweek(t)
time_get(t, field)


Unix time:

text
time_unix(sec[, nsec])
time_milli(msec)
time_micro(usec)
time_nano(nsec)
time_to_unix(t)
time_to_milli(t)
time_to_micro(t)
time_to_nano(t)


Time comparison:

text
time_after(t, u)
time_before(t, u)
time_compare(t, u)
time_equal(t, u)


Time arithmetic:

text
time_add(t, d)
time_add_date(t, years[, months[, days]])
time_sub(t, u)
time_since(t)
time_until(t)


Rounding:

text
time_trunc(t, field)
time_trunc(t, d)
time_round(t, d)


Formatting:

text
time_fmt_iso(t[, offset_sec])
time_fmt_datetime(t[, offset_sec])
time_fmt_date(t[, offset_sec])
time_fmt_time(t[, offset_sec])
time_parse(s)


Duration constants:

text
dur_ns()
dur_us()
dur_ms()
dur_s()
dur_m()
dur_h()


See the [docs](https://github.com/nalgeon/sqlean/blob/main/docs/time.md) for full details.

0.26.0

This release introduces consistent naming. All functions are now prefixed with the module name:

- crypto_md5,
- fuzzy_hamming,
- stats_median,
- etc.

⚠️ The old names are retained for now for backward compatibility, but may be removed in future releases.

0.25.0

Unicode-aware case functions in the [text](https://github.com/nalgeon/sqlean/blob/main/docs/text.md) extension. Powered by [stc](https://github.com/stclib/stc) from tylov. Thank you, Tyge!

⚠️ The [unicode](https://github.com/nalgeon/sqlean/blob/main/docs/unicode.md) extension is now deprecated and will be removed in future releases. Use the text extension instead.

text_upper

Transforms a string to upper case.

sql
select text_upper('cómo estás');
-- CÓMO ESTÁS


text_lower

Transforms a string to lower case.

sql
select text_lower('CÓMO ESTÁS');
-- cómo estás


text_title

Transforms a string to title case.

sql
select text_title('cómo estás');
-- Cómo Estás


text_like

Reports whether a string matches a pattern using the LIKE syntax.

sql
select text_like('cóm_ está_', 'CÓMO ESTÁS');
-- 1

select text_like('ça%', 'Ça roule');
-- 1


text_nocase

The `text_nocase` collating sequence compares strings without regard to case.

sql
select 1 where 'cómo estás' = 'CÓMO ESTÁS';
-- (null)

select 1 where 'cómo estás' = 'CÓMO ESTÁS' collate text_nocase;
-- 1

Page 1 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.