Change type of IDs in database from String to u64 #10

Closed
opened 2023-11-23 12:32:20 +00:00 by phundrak · 1 comment
Owner

While SQLite does not support u64 types in its schema, it does support i64 integers as INTEGER types. Using as in Rust to convert between u64 and i64 integers is no-op and would allow storing Discord IDs as numeric values instead of strings.

let a: i64 = 10;
let b = a as u64; // bitcasted a to a u64
let c = b as i64; // bitcasted b to a i64
While SQLite does not support `u64` types in its schema, it does support `i64` integers as `INTEGER` types. Using `as` in Rust to convert between `u64` and `i64` integers is no-op and would allow storing Discord IDs as numeric values instead of strings. ```rust let a: i64 = 10; let b = a as u64; // bitcasted a to a u64 let c = b as i64; // bitcasted b to a i64 ```
phundrak added the
enhancement
label 2023-11-23 12:32:20 +00:00
phundrak added a new dependency 2023-11-23 12:32:37 +00:00
phundrak added a new dependency 2023-11-23 12:32:46 +00:00
phundrak added this to the Log @everyone mentions project 2023-11-23 12:33:42 +00:00
Author
Owner

Implemented in #9

Implemented in #9
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: phundrak/p4bl0t#10
No description provided.