@edadma/rdb 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -8
- package/main.js +39936 -36850
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# @edadma/rdb
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@edadma/rdb)
|
|
4
|
-
|
|
5
3
|
A lightweight, in-memory SQL database for JavaScript and TypeScript. No native dependencies, no external services — just import and query. Follows PostgreSQL conventions for SQL syntax, identifier handling, and type casting.
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
@@ -72,6 +70,7 @@ RDB follows PostgreSQL conventions:
|
|
|
72
70
|
| `NUMERIC(p, s)` / `DECIMAL(p, s)` | Fixed-precision decimal |
|
|
73
71
|
| `TEXT` | Variable-length string |
|
|
74
72
|
| `CHAR(n)` | Fixed-length string |
|
|
73
|
+
| `VARCHAR(n)` | Variable-length string (max n chars) |
|
|
75
74
|
| `BOOLEAN` | True/false |
|
|
76
75
|
| `DATE` / `TIME` / `TIMESTAMP` | Date and time types |
|
|
77
76
|
| `TIMESTAMP WITH TIME ZONE` | Timezone-aware timestamp |
|
|
@@ -143,17 +142,17 @@ DEALLOCATE name
|
|
|
143
142
|
|
|
144
143
|
### Aggregate Functions
|
|
145
144
|
|
|
146
|
-
`COUNT`, `SUM`, `AVG`, `MIN`, `MAX`, `string_agg`, `array_agg`, `bool_and`, `bool_or`, `variance`, `var_samp`, `var_pop`, `stddev`, `stddev_samp`, `stddev_pop`
|
|
145
|
+
`COUNT`, `SUM`, `AVG`, `MIN`, `MAX`, `string_agg`, `array_agg`, `bool_and`, `bool_or`, `every`, `variance`, `var_samp`, `var_pop`, `stddev`, `stddev_samp`, `stddev_pop`
|
|
147
146
|
|
|
148
147
|
### Built-in Functions
|
|
149
148
|
|
|
150
|
-
**Text:** `lower`, `upper`, `initcap`, `length`, `trim`, `ltrim`, `rtrim`, `substring`, `left`, `right`, `lpad`, `rpad`, `replace`, `concat`, `concat_ws`, `repeat`, `reverse`, `position`, `split_part`, `ascii`, `chr`, `regexp_replace`, `regexp_match`, `starts_with`, `ends_with`
|
|
149
|
+
**Text:** `lower`, `upper`, `initcap`, `length`, `trim`, `ltrim`, `rtrim`, `btrim`, `substring`, `left`, `right`, `lpad`, `rpad`, `replace`, `translate`, `concat`, `concat_ws`, `repeat`, `reverse`, `position`, `split_part`, `ascii`, `chr`, `regexp_replace`, `regexp_match`, `starts_with`, `ends_with`
|
|
151
150
|
|
|
152
|
-
**Numeric:** `abs`, `ceil`, `floor`, `round`, `trunc`, `sign`, `mod`, `power`, `sqrt`, `exp`, `ln`, `log10`, `log`, `pi`, `degrees`, `radians`, `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `atan2`, `random`, `greatest`, `least
|
|
151
|
+
**Numeric:** `abs`, `ceil`, `floor`, `round`, `trunc`, `sign`, `mod`, `%`, `power`, `sqrt`, `cbrt`, `exp`, `ln`, `log10`, `log`, `pi`, `degrees`, `radians`, `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `atan2`, `sinh`, `cosh`, `tanh`, `asinh`, `acosh`, `atanh`, `div`, `factorial`, `gcd`, `lcm`, `random`, `greatest`, `least`, `&` (AND), `|` (OR), `#` (XOR), `~` (NOT), `<<` (shift left), `>>` (shift right)
|
|
153
152
|
|
|
154
|
-
**Date/Time:** `now`, `current_date`, `current_time`, `date_part`, `EXTRACT`, `date_trunc`, `make_date`, `make_time`, `age`, `to_char`, `to_date`, `to_timestamp`
|
|
153
|
+
**Date/Time:** `now`, `current_date`, `current_time`, `date_part`, `EXTRACT`, `date_trunc`, `make_date`, `make_time`, `make_timestamp`, `make_interval`, `age`, `to_char`, `to_date`, `to_timestamp`, `to_number`, `isfinite`
|
|
155
154
|
|
|
156
|
-
**Array:** `array_length`, `array_append`, `array_prepend`, `array_concat`, `array_slice`, `array_remove`, `array_position`, `array_distinct`, `string_to_array`, `array_to_string`
|
|
155
|
+
**Array:** `array_length`, `array_append`, `array_prepend`, `array_concat`, `array_cat`, `array_slice`, `array_remove`, `array_replace`, `array_position`, `array_distinct`, `array_lower`, `array_upper`, `array_ndims`, `cardinality`, `string_to_array`, `array_to_string`
|
|
157
156
|
|
|
158
157
|
**Other:** `coalesce`, `nullif`, `typeof`, `gen_random_uuid`, `octet_length`, `encode`, `decode`
|
|
159
158
|
|
|
@@ -211,7 +210,7 @@ Every result has a `command` field for easy discrimination:
|
|
|
211
210
|
| SQL Type | JavaScript Type |
|
|
212
211
|
|----------|----------------|
|
|
213
212
|
| INT, BIGINT, DOUBLE, NUMERIC | `number` |
|
|
214
|
-
| TEXT, CHAR | `string` |
|
|
213
|
+
| TEXT, CHAR, VARCHAR | `string` |
|
|
215
214
|
| BOOLEAN | `boolean` |
|
|
216
215
|
| UUID | `string` |
|
|
217
216
|
| TIMESTAMP | `Date` |
|