Commit Graph

47 Commits

Author SHA1 Message Date
Namekuji afe4c76392
fix migration 2023-06-02 23:48:28 -04:00
Namekuji d3d30bbbc2
add integration test of antenna 2023-06-02 23:48:28 -04:00
Namekuji 874b0a2c69
add unit test 2023-06-02 23:48:27 -04:00
Namekuji 7cf2b39cde
fix unit tests 2023-06-02 23:48:27 -04:00
Namekuji c443a5601c
add format script 2023-06-02 23:48:27 -04:00
Namekuji 0224824a36
fix native import 2023-06-02 23:48:26 -04:00
Namekuji 55118df538
add test 2023-06-02 23:48:25 -04:00
Namekuji a10ade8cf5
fix unit test 2023-06-02 23:48:24 -04:00
Namekuji 752d63e6de
add native calls 2023-06-02 23:48:24 -04:00
Namekuji e932d6effa
use schema in native-utils 2023-06-02 23:48:24 -04:00
Namekuji 5e9dce3e8c
adjust module structure 2023-06-02 23:48:23 -04:00
Namekuji 148dbbe56d
move files out from crate 2023-06-02 23:48:23 -04:00
Namekuji 403e95b673
fix unit test 2023-06-02 23:48:22 -04:00
Namekuji e51deb3794
add napi schema 2023-06-02 23:48:22 -04:00
Namekuji d0734ef4c9
add pack_by_id 2023-06-02 23:48:22 -04:00
Namekuji c9f31aef9b
add default values 2023-06-02 23:48:21 -04:00
Namekuji 3eb87c8f04
rename feature 2023-06-02 23:48:21 -04:00
Namekuji 193c75a2bb
skip empty array 2023-06-02 23:48:21 -04:00
Namekuji d9d2673939
use thread to copy data 2023-06-02 23:48:20 -04:00
Namekuji 3010ac9e74
use iden enum 2023-06-02 23:48:20 -04:00
Namekuji d28f74b513
fix primary key specifier 2023-06-02 23:48:20 -04:00
Namekuji 98f2397fbb
add migration to convert array to jsonb 2023-06-02 23:48:19 -04:00
Namekuji 745384ff58
use vec newtype 2023-06-02 23:48:19 -04:00
Namekuji 6178593e22
make sqlite compat 2023-06-02 23:48:19 -04:00
Namekuji 354ece6432
add abstraction of string array type 2023-06-02 23:48:18 -04:00
Namekuji 0bd5893e7d
fix varchar array 2023-06-02 23:48:18 -04:00
Namekuji 1455068e0c
add newtype 2023-06-02 23:48:18 -04:00
Namekuji 76e5e31411
todo unread note check 2023-06-02 23:48:17 -04:00
Namekuji 6698c00f78
rename test modules 2023-06-02 23:48:17 -04:00
Namekuji 6bbfe1a6b4
add tests 2023-06-02 23:48:17 -04:00
Namekuji 4012d38f7f
add integration test in model 2023-06-02 23:48:16 -04:00
Namekuji 737ccfe11c
remove mock database 2023-06-02 23:48:16 -04:00
Namekuji f1f3e5976d
add random string generator 2023-06-02 23:48:15 -04:00
Namekuji 6bb8775b2e
change aid to cuid2 2023-06-02 23:48:15 -04:00
Namekuji eda1e7ab3b
fix features 2023-06-02 23:48:15 -04:00
Namekuji 00ba8a2804
return mock db when mock feature is enabled 2023-06-02 23:48:14 -04:00
Namekuji 2f9a6859f1
add utility crate 2023-06-02 23:48:14 -04:00
Namekuji 535eb3540b
add mock database 2023-06-02 23:48:14 -04:00
Namekuji d453eaf4ae
remove unused feature 2023-06-02 23:48:13 -04:00
Namekuji 81ba464f1b
format 2023-06-02 23:48:13 -04:00
Namekuji 9220aa3e4c
remove unused serde 2023-06-02 23:48:13 -04:00
Namekuji bc0e0b14d0
add repository trait 2023-06-02 23:48:12 -04:00
Namekuji 4e82dab1eb
add entities and two schemas 2023-06-02 23:48:07 -04:00
ThatOneCalculator 655cf3dc27
chore: format 2023-05-29 09:31:02 -07:00
Namekuji 98f9e3e5c4
use cuid2 with timestamp 2023-05-28 22:16:42 -04:00
Kainoa Kanter 7fb130b06e formatting 2023-04-06 18:56:46 -07:00
s1idewhist1e c58ce6c53b Refactor: use rust for native mastodon id conversion (#9786)
This uses [napi-rs](https://napi.rs/) to allow for automatic generation of node bindings for the native code.

I also changed the `isolatedModules` TS flag to false to allow for `static enum` to be shared across modules. It doesn't seem to be necessary for the build system that CK uses.

Currently this method does not work with ID generators with longer IDs. Likely the best solution is to add another key in the database.

Some benchmarks for 1 million conversions:

```
	node, x1_000_000: 2.847s
	rust, x1_000_000: 1.265s
```

There are still optimizations that can be made, but I think this is a good starting point and a good way to bring rust into the CK stack.

Co-authored-by: s1idewhist1e <trombonedude05@gmail.com>
Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9786
Co-authored-by: s1idewhist1e <s1idewhist1e@noreply.codeberg.org>
Co-committed-by: s1idewhist1e <s1idewhist1e@noreply.codeberg.org>
2023-03-31 01:58:28 +00:00