mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-22 01:29:31 -04:00
Compare commits
156
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a938ceed1 | ||
|
|
62d708e357 | ||
|
|
72083eb030 | ||
|
|
62afa22d8c | ||
|
|
418b116469 | ||
|
|
42c7c70387 | ||
|
|
39c52d5377 | ||
|
|
cea3668cfc | ||
|
|
1caf1f38b8 | ||
|
|
f0b2a07613 | ||
|
|
3cd04414f8 | ||
|
|
f3776e953c | ||
|
|
d923699009 | ||
|
|
f842d795d6 | ||
|
|
7a1ce7c9fd | ||
|
|
d0a3c02c00 | ||
|
|
32bc400686 | ||
|
|
e3973e4ce1 | ||
|
|
1d7bc11be3 | ||
|
|
5321eb145d | ||
|
|
48043fb602 | ||
|
|
8af2035ee6 | ||
|
|
1e2f73e44a | ||
|
|
b49a7225e4 | ||
|
|
de01700359 | ||
|
|
f7990e2b61 | ||
|
|
081307d735 | ||
|
|
397241fb84 | ||
|
|
dbc0f5f62e | ||
|
|
b521fa7676 | ||
|
|
a67f60d09e | ||
|
|
2cdf9ce41f | ||
|
|
38fb1a4a32 | ||
|
|
984fd1a21f | ||
|
|
8b92dc4099 | ||
|
|
86677b8f97 | ||
|
|
ed7a9905ee | ||
|
|
1c25c4085b | ||
|
|
91e739d7c4 | ||
|
|
40a82142bf | ||
|
|
f6454035d2 | ||
|
|
e93a8664c1 | ||
|
|
0ef4333013 | ||
|
|
cd11d0aa4e | ||
|
|
e8644d3b82 | ||
|
|
806f70d7ba | ||
|
|
b6eb0e9394 | ||
|
|
02050ef86c | ||
|
|
9b698d155e | ||
|
|
ed359164ff | ||
|
|
2da81d47a7 | ||
|
|
cb1253f509 | ||
|
|
f21da59530 | ||
|
|
4ebb7fe282 | ||
|
|
83764e2381 | ||
|
|
475ed299db | ||
|
|
53786bf9b9 | ||
|
|
3a7fcc1595 | ||
|
|
770293af49 | ||
|
|
bb19960c02 | ||
|
|
f3cde45f33 | ||
|
|
6adb104e58 | ||
|
|
3a1220853d | ||
|
|
b1732a0d11 | ||
|
|
c767a17da7 | ||
|
|
a2a7a10d0c | ||
|
|
d6ac0c9d0b | ||
|
|
ea90bb6758 | ||
|
|
252576b88a | ||
|
|
f7ed250c7c | ||
|
|
0b5530c8a3 | ||
|
|
606a439352 | ||
|
|
aec5675784 | ||
|
|
db05b61c51 | ||
|
|
7141aa028f | ||
|
|
90bfb2c2bf | ||
|
|
7f43e98f07 | ||
|
|
9ebd040d59 | ||
|
|
f890f8781c | ||
|
|
3e35db2f8e | ||
|
|
4b53df69a0 | ||
|
|
bca8925f31 | ||
|
|
d0a51f0344 | ||
|
|
4397e29886 | ||
|
|
ac4a7f4612 | ||
|
|
87a768890a | ||
|
|
9bfd0330a9 | ||
|
|
a8766e9620 | ||
|
|
3b3b218e0c | ||
|
|
1f595f3d64 | ||
|
|
7297f77334 | ||
|
|
7186f37841 | ||
|
|
767a2a38da | ||
|
|
d43bffc0a2 | ||
|
|
ec0514187a | ||
|
|
a840e3c97e | ||
|
|
be1ea1e4f0 | ||
|
|
2a3ec1e761 | ||
|
|
f4a3ccc0fb | ||
|
|
8b9d3d2cc0 | ||
|
|
9ef54a3d55 | ||
|
|
aebe2f9892 | ||
|
|
47a72bed0f | ||
|
|
7af123b2ad | ||
|
|
8c8ad1d2e5 | ||
|
|
cea2a3d0f1 | ||
|
|
134402c536 | ||
|
|
63298b5154 | ||
|
|
ad258b7ba6 | ||
|
|
499c1b6c2e | ||
|
|
649558e91d | ||
|
|
ca2dee55ab | ||
|
|
1edb7d10fc | ||
|
|
b6e94089d9 | ||
|
|
8091da6d3c | ||
|
|
2986385bfb | ||
|
|
2b40807dd2 | ||
|
|
d2f24e3f8c | ||
|
|
21162c3df5 | ||
|
|
6bd31c7075 | ||
|
|
c0627eee28 | ||
|
|
26eedbcfb3 | ||
|
|
37d922510d | ||
|
|
b167280a64 | ||
|
|
e9103cafb8 | ||
|
|
61811e4ef2 | ||
|
|
03679b15eb | ||
|
|
f4d620ac4f | ||
|
|
7f2afe59c0 | ||
|
|
966e311d24 | ||
|
|
010d5f8790 | ||
|
|
6607460f39 | ||
|
|
e4198e8ac6 | ||
|
|
acd71fa2cd | ||
|
|
bae0355a86 | ||
|
|
999051f83f | ||
|
|
a1a4e7e9df | ||
|
|
d728b678c8 | ||
|
|
a223d64db7 | ||
|
|
f1482c0076 | ||
|
|
deb0ebc5e9 | ||
|
|
bf538b55d1 | ||
|
|
47ffa5696a | ||
|
|
f6e4eec00d | ||
|
|
8b1f4b3005 | ||
|
|
32c50cb3c6 | ||
|
|
774f7e7e3a | ||
|
|
c4f51c9fae | ||
|
|
6266985577 | ||
|
|
ac899f2b56 | ||
|
|
bc4cf3617c | ||
|
|
0ee2d9548a | ||
|
|
67bf6e436e | ||
|
|
c4e4d8e12b | ||
|
|
5c5fd10d60 | ||
|
|
d7155e55d7 |
Generated
+1
@@ -50,6 +50,7 @@
|
||||
<w>unpermitted</w>
|
||||
<w>upserting</w>
|
||||
<w>upserts</w>
|
||||
<w>upvoted</w>
|
||||
<w>vits</w>
|
||||
<w>vocoded</w>
|
||||
<w>vocoder</w>
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nINSERT INTO media_files\nSET\n token = ?,\n\n media_class = ?,\n media_type = ?,\n\n origin_category = ?,\n origin_product_category = ?,\n maybe_origin_model_type = ?,\n\n maybe_mime_type = ?,\n file_size_bytes = ?,\n\n checksum_sha2 = ?,\n\n maybe_style_transfer_source_media_file_token = ?,\n maybe_scene_source_media_file_token = ?,\n\n maybe_title = ?,\n maybe_prompt_token = ?,\n\n public_bucket_directory_hash = ?,\n maybe_public_bucket_prefix = ?,\n maybe_public_bucket_extension = ?,\n\n maybe_creator_user_token = ?,\n maybe_creator_anonymous_visitor_token = ?,\n creator_ip_address = ?,\n\n creator_set_visibility = ?,\n\n maybe_creator_file_synthetic_id = ?,\n maybe_creator_category_synthetic_id = ?,\n\n is_generated_on_prem = ?,\n generated_by_worker = ?,\n generated_by_cluster = ?\n\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 25
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "039c24023c93deacc0b09fbbfe747821ba9f7e06bc17f651628edf1a82f5feb6"
|
||||
}
|
||||
+50
-28
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\n SELECT\n wt.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n wt.title,\n wt.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n wt.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n wt.maybe_description_markdown,\n wt.maybe_description_rendered_html,\n wt.creator_ip_address,\n wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash AS creator_gravatar_hash,\n\n wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n wt.original_download_url,\n wt.original_filename,\n wt.file_size_bytes,\n wt.file_checksum_sha2,\n wt.public_bucket_hash,\n wt.maybe_public_bucket_prefix,\n wt.maybe_public_bucket_extension,\n\n cover_image.public_bucket_directory_hash as maybe_cover_image_public_bucket_hash,\n cover_image.maybe_public_bucket_prefix as maybe_cover_image_public_bucket_prefix,\n cover_image.maybe_public_bucket_extension as maybe_cover_image_public_bucket_extension,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n wt.cached_usage_count,\n\n featured_items.entity_token IS NOT NULL AS is_featured,\n\n wt.version,\n wt.created_at,\n wt.updated_at,\n wt.user_deleted_at,\n wt.mod_deleted_at\n\n FROM model_weights as wt\n JOIN users\n ON users.token = wt.creator_user_token\n LEFT OUTER JOIN media_files as cover_image\n ON cover_image.token = wt.maybe_cover_image_media_file_token\n LEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"model_weight\"\n AND entity_stats.entity_token = wt.token\n LEFT OUTER JOIN featured_items\n ON featured_items.entity_type = \"model_weight\"\n AND featured_items.entity_token = wt.token\n AND featured_items.deleted_at IS NULL\n WHERE\n wt.token = ?\n AND wt.user_deleted_at IS NULL\n AND wt.mod_deleted_at IS NULL\n ",
|
||||
"query": "\n SELECT\n wt.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n wt.title,\n wt.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n wt.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n wt.maybe_description_markdown,\n wt.maybe_description_rendered_html,\n\n wt.maybe_ietf_language_tag,\n wt.maybe_ietf_primary_language_subtag,\n\n wt.creator_ip_address,\n wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash AS creator_gravatar_hash,\n\n wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n wt.original_download_url,\n wt.original_filename,\n wt.file_size_bytes,\n wt.file_checksum_sha2,\n wt.public_bucket_hash,\n wt.maybe_public_bucket_prefix,\n wt.maybe_public_bucket_extension,\n\n cover_image.public_bucket_directory_hash as maybe_cover_image_public_bucket_hash,\n cover_image.maybe_public_bucket_prefix as maybe_cover_image_public_bucket_prefix,\n cover_image.maybe_public_bucket_extension as maybe_cover_image_public_bucket_extension,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n wt.cached_usage_count,\n\n featured_items.entity_token IS NOT NULL AS is_featured,\n\n wt.version,\n wt.created_at,\n wt.updated_at,\n wt.user_deleted_at,\n wt.mod_deleted_at\n\n FROM model_weights as wt\n JOIN users\n ON users.token = wt.creator_user_token\n LEFT OUTER JOIN media_files as cover_image\n ON cover_image.token = wt.maybe_cover_image_media_file_token\n LEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"model_weight\"\n AND entity_stats.entity_token = wt.token\n LEFT OUTER JOIN featured_items\n ON featured_items.entity_type = \"model_weight\"\n AND featured_items.entity_token = wt.token\n AND featured_items.deleted_at IS NULL\n WHERE\n wt.token = ?\n AND wt.user_deleted_at IS NULL\n AND wt.mod_deleted_at IS NULL\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -65,6 +65,26 @@
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "maybe_ietf_language_tag",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "BINARY",
|
||||
"char_set": 224,
|
||||
"max_size": 256
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "maybe_ietf_primary_language_subtag",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "BINARY",
|
||||
"char_set": 224,
|
||||
"max_size": 48
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "creator_ip_address",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -74,7 +94,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"ordinal": 9,
|
||||
"name": "creator_set_visibility: enums::common::visibility::Visibility",
|
||||
"type_info": {
|
||||
"type": "String",
|
||||
@@ -84,7 +104,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"ordinal": 10,
|
||||
"name": "creator_user_token: tokens::tokens::users::UserToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -94,7 +114,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"ordinal": 11,
|
||||
"name": "creator_username",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -104,7 +124,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"ordinal": 12,
|
||||
"name": "creator_display_name",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -114,7 +134,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 11,
|
||||
"ordinal": 13,
|
||||
"name": "creator_gravatar_hash",
|
||||
"type_info": {
|
||||
"type": "String",
|
||||
@@ -124,7 +144,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 12,
|
||||
"ordinal": 14,
|
||||
"name": "maybe_last_update_user_token: tokens::tokens::users::UserToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -134,7 +154,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 13,
|
||||
"ordinal": 15,
|
||||
"name": "original_download_url",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -144,7 +164,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 14,
|
||||
"ordinal": 16,
|
||||
"name": "original_filename",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -154,7 +174,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 15,
|
||||
"ordinal": 17,
|
||||
"name": "file_size_bytes",
|
||||
"type_info": {
|
||||
"type": "LongLong",
|
||||
@@ -164,7 +184,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 16,
|
||||
"ordinal": 18,
|
||||
"name": "file_checksum_sha2",
|
||||
"type_info": {
|
||||
"type": "String",
|
||||
@@ -174,7 +194,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 17,
|
||||
"ordinal": 19,
|
||||
"name": "public_bucket_hash",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -184,7 +204,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 18,
|
||||
"ordinal": 20,
|
||||
"name": "maybe_public_bucket_prefix",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -194,7 +214,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 19,
|
||||
"ordinal": 21,
|
||||
"name": "maybe_public_bucket_extension",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -204,7 +224,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 20,
|
||||
"ordinal": 22,
|
||||
"name": "maybe_cover_image_public_bucket_hash",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -214,7 +234,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 21,
|
||||
"ordinal": 23,
|
||||
"name": "maybe_cover_image_public_bucket_prefix",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -224,7 +244,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 22,
|
||||
"ordinal": 24,
|
||||
"name": "maybe_cover_image_public_bucket_extension",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -234,7 +254,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 23,
|
||||
"ordinal": 25,
|
||||
"name": "maybe_ratings_positive_count",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
@@ -244,7 +264,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 24,
|
||||
"ordinal": 26,
|
||||
"name": "maybe_ratings_negative_count",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
@@ -254,7 +274,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 25,
|
||||
"ordinal": 27,
|
||||
"name": "maybe_bookmark_count",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
@@ -264,7 +284,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 26,
|
||||
"ordinal": 28,
|
||||
"name": "cached_usage_count",
|
||||
"type_info": {
|
||||
"type": "LongLong",
|
||||
@@ -274,7 +294,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 27,
|
||||
"ordinal": 29,
|
||||
"name": "is_featured",
|
||||
"type_info": {
|
||||
"type": "LongLong",
|
||||
@@ -284,7 +304,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 28,
|
||||
"ordinal": 30,
|
||||
"name": "version",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
@@ -294,7 +314,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 29,
|
||||
"ordinal": 31,
|
||||
"name": "created_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
@@ -304,7 +324,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 30,
|
||||
"ordinal": 32,
|
||||
"name": "updated_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
@@ -314,7 +334,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 31,
|
||||
"ordinal": 33,
|
||||
"name": "user_deleted_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
@@ -324,7 +344,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 32,
|
||||
"ordinal": 34,
|
||||
"name": "mod_deleted_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
@@ -344,6 +364,8 @@
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
@@ -373,5 +395,5 @@
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "1053294a21439ddb41fdd1053547b3f5c50457f6ba9450e5167a1db5caf896d1"
|
||||
"hash": "29fe7f8464257537840d7f095ec01f850d79f970109549d14978fc3bed7cef32"
|
||||
}
|
||||
+29
-7
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nSELECT\n token as `token: tokens::tokens::users::UserToken`,\n username,\n email_address,\n password_hash as `password_hash: crate::queries::users::user::lookup_user_for_login_result::VecBytes`,\n password_version,\n is_banned,\n maybe_feature_flags\nFROM users\nWHERE username = ?\nLIMIT 1\n ",
|
||||
"query": "\nSELECT\n token as `token: tokens::tokens::users::UserToken`,\n username,\n display_name,\n username_is_not_customized,\n email_address,\n password_hash as `password_hash: crate::queries::users::user::get::lookup_user_for_login_result::VecBytes`,\n password_version,\n is_banned,\n maybe_feature_flags\nFROM users\nWHERE username = ?\nLIMIT 1\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -25,6 +25,26 @@
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "display_name",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
|
||||
"char_set": 224,
|
||||
"max_size": 80
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "username_is_not_customized",
|
||||
"type_info": {
|
||||
"type": "Tiny",
|
||||
"flags": "NOT_NULL",
|
||||
"char_set": 63,
|
||||
"max_size": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "email_address",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -34,8 +54,8 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "password_hash: crate::queries::users::user::lookup_user_for_login_result::VecBytes",
|
||||
"ordinal": 5,
|
||||
"name": "password_hash: crate::queries::users::user::get::lookup_user_for_login_result::VecBytes",
|
||||
"type_info": {
|
||||
"type": "String",
|
||||
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
|
||||
@@ -44,7 +64,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"ordinal": 6,
|
||||
"name": "password_version",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
@@ -54,7 +74,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"ordinal": 7,
|
||||
"name": "is_banned",
|
||||
"type_info": {
|
||||
"type": "Tiny",
|
||||
@@ -64,7 +84,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"ordinal": 8,
|
||||
"name": "maybe_feature_flags",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -84,8 +104,10 @@
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "8e577db7abde571a0f29fc9d678891349918f0882136d9f7a39b338f66270f11"
|
||||
"hash": "2bc80729a61545b39cc633ca79af612ce611d358b32149405340d985060d4bbe"
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nSELECT\n t.token as `token: tokens::tokens::tags::TagToken`,\n t.tag_value\n\nFROM\n tags AS t\nJOIN tag_uses AS u\n ON t.token = u.tag_token\nWHERE\n u.entity_type = ?\n AND u.entity_token = ?\n AND u.maybe_deleted_at IS NULL\nORDER BY t.id DESC\nLIMIT 500\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "token: tokens::tokens::tags::TagToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
"char_set": 224,
|
||||
"max_size": 128
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "tag_value",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
"char_set": 224,
|
||||
"max_size": 1020
|
||||
}
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "3929e9fe74e75fad7252681880c6c3bd7e76e96b0bf603f77f6a9b2d4fcda18d"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nDELETE FROM tag_uses\nWHERE entity_type = ?\nAND entity_token = ?\nLIMIT 1\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "41b16ccf04ef1ffb8b48bc59edf9389f61f54b871f6361f35529706b98d419ec"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nINSERT INTO users\nSET\n token = ?,\n username = ?,\n display_name = ?,\n\n username_is_generated = ?,\n username_is_not_customized = ?,\n\n email_address = ?,\n email_gravatar_hash = ?,\n\n email_confirmed = FALSE,\n email_confirmed_by_google = ?,\n\n profile_markdown = ?,\n profile_rendered_html = ?,\n user_role_slug = ?,\n\n password_hash = ?,\n is_without_password = ?,\n\n maybe_feature_flags = ?,\n\n ip_address_creation = ?,\n ip_address_last_login = ?,\n ip_address_last_update = ?,\n\n maybe_source = ?,\n\n maybe_signup_method = ?\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 19
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "453f0386cfe34e533501ba29dc2022fc449266f9858f16886bde9a0df6b82026"
|
||||
}
|
||||
+50
-28
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\n SELECT\n wt.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n wt.title,\n wt.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n wt.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n wt.maybe_description_markdown,\n wt.maybe_description_rendered_html,\n\n wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash AS creator_gravatar_hash,\n\n wt.creator_ip_address,\n wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n wt.original_download_url,\n wt.original_filename,\n wt.file_size_bytes,\n wt.file_checksum_sha2,\n\n wt.public_bucket_hash,\n wt.maybe_public_bucket_prefix,\n wt.maybe_public_bucket_extension,\n\n cover_image.public_bucket_directory_hash as maybe_cover_image_public_bucket_hash,\n cover_image.maybe_public_bucket_prefix as maybe_cover_image_public_bucket_prefix,\n cover_image.maybe_public_bucket_extension as maybe_cover_image_public_bucket_extension,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n wt.cached_usage_count,\n\n featured_items.entity_token IS NOT NULL AS is_featured,\n\n wt.version,\n wt.created_at,\n wt.updated_at,\n wt.user_deleted_at,\n wt.mod_deleted_at\n\n FROM model_weights as wt\n JOIN users\n ON users.token = wt.creator_user_token\n LEFT OUTER JOIN media_files as cover_image\n ON cover_image.token = wt.maybe_cover_image_media_file_token\n LEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"model_weight\"\n AND entity_stats.entity_token = wt.token\n LEFT OUTER JOIN featured_items\n ON featured_items.entity_type = \"model_weight\"\n AND featured_items.entity_token = wt.token\n AND featured_items.deleted_at IS NULL\n WHERE\n wt.token = ?\n ",
|
||||
"query": "\n SELECT\n wt.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n wt.title,\n wt.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n wt.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n wt.maybe_description_markdown,\n wt.maybe_description_rendered_html,\n\n wt.maybe_ietf_language_tag,\n wt.maybe_ietf_primary_language_subtag,\n\n wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash AS creator_gravatar_hash,\n\n wt.creator_ip_address,\n wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n wt.original_download_url,\n wt.original_filename,\n wt.file_size_bytes,\n wt.file_checksum_sha2,\n\n wt.public_bucket_hash,\n wt.maybe_public_bucket_prefix,\n wt.maybe_public_bucket_extension,\n\n cover_image.public_bucket_directory_hash as maybe_cover_image_public_bucket_hash,\n cover_image.maybe_public_bucket_prefix as maybe_cover_image_public_bucket_prefix,\n cover_image.maybe_public_bucket_extension as maybe_cover_image_public_bucket_extension,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n wt.cached_usage_count,\n\n featured_items.entity_token IS NOT NULL AS is_featured,\n\n wt.version,\n wt.created_at,\n wt.updated_at,\n wt.user_deleted_at,\n wt.mod_deleted_at\n\n FROM model_weights as wt\n JOIN users\n ON users.token = wt.creator_user_token\n LEFT OUTER JOIN media_files as cover_image\n ON cover_image.token = wt.maybe_cover_image_media_file_token\n LEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"model_weight\"\n AND entity_stats.entity_token = wt.token\n LEFT OUTER JOIN featured_items\n ON featured_items.entity_type = \"model_weight\"\n AND featured_items.entity_token = wt.token\n AND featured_items.deleted_at IS NULL\n WHERE\n wt.token = ?\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -65,6 +65,26 @@
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "maybe_ietf_language_tag",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "BINARY",
|
||||
"char_set": 224,
|
||||
"max_size": 256
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "maybe_ietf_primary_language_subtag",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "BINARY",
|
||||
"char_set": 224,
|
||||
"max_size": 48
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "creator_user_token: tokens::tokens::users::UserToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -74,7 +94,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"ordinal": 9,
|
||||
"name": "creator_username",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -84,7 +104,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"ordinal": 10,
|
||||
"name": "creator_display_name",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -94,7 +114,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"ordinal": 11,
|
||||
"name": "creator_gravatar_hash",
|
||||
"type_info": {
|
||||
"type": "String",
|
||||
@@ -104,7 +124,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"ordinal": 12,
|
||||
"name": "creator_ip_address",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -114,7 +134,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 11,
|
||||
"ordinal": 13,
|
||||
"name": "creator_set_visibility: enums::common::visibility::Visibility",
|
||||
"type_info": {
|
||||
"type": "String",
|
||||
@@ -124,7 +144,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 12,
|
||||
"ordinal": 14,
|
||||
"name": "maybe_last_update_user_token: tokens::tokens::users::UserToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -134,7 +154,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 13,
|
||||
"ordinal": 15,
|
||||
"name": "original_download_url",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -144,7 +164,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 14,
|
||||
"ordinal": 16,
|
||||
"name": "original_filename",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -154,7 +174,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 15,
|
||||
"ordinal": 17,
|
||||
"name": "file_size_bytes",
|
||||
"type_info": {
|
||||
"type": "LongLong",
|
||||
@@ -164,7 +184,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 16,
|
||||
"ordinal": 18,
|
||||
"name": "file_checksum_sha2",
|
||||
"type_info": {
|
||||
"type": "String",
|
||||
@@ -174,7 +194,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 17,
|
||||
"ordinal": 19,
|
||||
"name": "public_bucket_hash",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -184,7 +204,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 18,
|
||||
"ordinal": 20,
|
||||
"name": "maybe_public_bucket_prefix",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -194,7 +214,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 19,
|
||||
"ordinal": 21,
|
||||
"name": "maybe_public_bucket_extension",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -204,7 +224,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 20,
|
||||
"ordinal": 22,
|
||||
"name": "maybe_cover_image_public_bucket_hash",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -214,7 +234,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 21,
|
||||
"ordinal": 23,
|
||||
"name": "maybe_cover_image_public_bucket_prefix",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -224,7 +244,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 22,
|
||||
"ordinal": 24,
|
||||
"name": "maybe_cover_image_public_bucket_extension",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -234,7 +254,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 23,
|
||||
"ordinal": 25,
|
||||
"name": "maybe_ratings_positive_count",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
@@ -244,7 +264,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 24,
|
||||
"ordinal": 26,
|
||||
"name": "maybe_ratings_negative_count",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
@@ -254,7 +274,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 25,
|
||||
"ordinal": 27,
|
||||
"name": "maybe_bookmark_count",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
@@ -264,7 +284,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 26,
|
||||
"ordinal": 28,
|
||||
"name": "cached_usage_count",
|
||||
"type_info": {
|
||||
"type": "LongLong",
|
||||
@@ -274,7 +294,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 27,
|
||||
"ordinal": 29,
|
||||
"name": "is_featured",
|
||||
"type_info": {
|
||||
"type": "LongLong",
|
||||
@@ -284,7 +304,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 28,
|
||||
"ordinal": 30,
|
||||
"name": "version",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
@@ -294,7 +314,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 29,
|
||||
"ordinal": 31,
|
||||
"name": "created_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
@@ -304,7 +324,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 30,
|
||||
"ordinal": 32,
|
||||
"name": "updated_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
@@ -314,7 +334,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 31,
|
||||
"ordinal": 33,
|
||||
"name": "user_deleted_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
@@ -324,7 +344,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 32,
|
||||
"ordinal": 34,
|
||||
"name": "mod_deleted_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
@@ -344,6 +364,8 @@
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
@@ -373,5 +395,5 @@
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "5e953a6ad7bcaaed0918109593652b03c7ab497cc65b59bbb6add011de6401f0"
|
||||
"hash": "53c90f5230aa202aead37a224ec70e350172bc0ec4eeaebde22878ca4aa0f695"
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nINSERT INTO users (\n token,\n username,\n display_name,\n email_address,\n email_gravatar_hash,\n profile_markdown,\n profile_rendered_html,\n user_role_slug,\n password_hash,\n ip_address_creation,\n ip_address_last_login,\n ip_address_last_update,\n maybe_source\n)\nVALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 13
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "58a2d6d0c5541049cc954e3ac09b3aaef894ca55e1cb7444b72f429394022f12"
|
||||
}
|
||||
+168
@@ -0,0 +1,168 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nSELECT\n g.token as `token: tokens::tokens::google_sign_in_accounts::GoogleSignInAccountToken`,\n\n g.subject,\n\n g.maybe_user_token as `maybe_user_token: tokens::tokens::users::UserToken`,\n\n g.email_address,\n g.is_email_verified,\n\n g.maybe_locale,\n g.maybe_name,\n g.maybe_given_name,\n g.maybe_family_name,\n\n g.created_at,\n g.updated_at,\n\n u.username as maybe_username,\n u.display_name as maybe_user_display_name,\n u.username_is_not_customized\n\nFROM google_sign_in_accounts AS g\nLEFT OUTER JOIN users AS u\n ON g.maybe_user_token = u.token\n\nWHERE\n g.subject = ?\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "token: tokens::tokens::google_sign_in_accounts::GoogleSignInAccountToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
"char_set": 224,
|
||||
"max_size": 128
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "subject",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
"char_set": 224,
|
||||
"max_size": 1020
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "maybe_user_token: tokens::tokens::users::UserToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "MULTIPLE_KEY | BINARY",
|
||||
"char_set": 224,
|
||||
"max_size": 128
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "email_address",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
"char_set": 224,
|
||||
"max_size": 1020
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "is_email_verified",
|
||||
"type_info": {
|
||||
"type": "Tiny",
|
||||
"flags": "NOT_NULL",
|
||||
"char_set": 63,
|
||||
"max_size": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"name": "maybe_locale",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "BINARY",
|
||||
"char_set": 224,
|
||||
"max_size": 1020
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "maybe_name",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "BINARY",
|
||||
"char_set": 224,
|
||||
"max_size": 1020
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "maybe_given_name",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "BINARY",
|
||||
"char_set": 224,
|
||||
"max_size": 1020
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "maybe_family_name",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "BINARY",
|
||||
"char_set": 224,
|
||||
"max_size": 1020
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"name": "created_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | TIMESTAMP",
|
||||
"char_set": 63,
|
||||
"max_size": 19
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"name": "updated_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | TIMESTAMP | ON_UPDATE_NOW",
|
||||
"char_set": 63,
|
||||
"max_size": 19
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 11,
|
||||
"name": "maybe_username",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
"char_set": 224,
|
||||
"max_size": 80
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 12,
|
||||
"name": "maybe_user_display_name",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "BINARY | NO_DEFAULT_VALUE",
|
||||
"char_set": 224,
|
||||
"max_size": 80
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 13,
|
||||
"name": "username_is_not_customized",
|
||||
"type_info": {
|
||||
"type": "Tiny",
|
||||
"flags": "",
|
||||
"char_set": 63,
|
||||
"max_size": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "76d9a995b3cecfcb39f1a41bb4896c4e317716dbde6b5f678bd9fd458544ab78"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nUPDATE generic_inference_jobs\nSET\n status = 'cancelled_by_user',\n retry_at = NULL\nWHERE status IN (\n 'pending',\n 'started',\n 'attempt_failed'\n )\nLIMIT 100\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "84320887e8157a450ad46ec0843071c60c054eab61958a9148789ed76cd476e3"
|
||||
}
|
||||
+29
-7
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nSELECT\n token as `token: tokens::tokens::users::UserToken`,\n username,\n email_address,\n password_hash as `password_hash: crate::queries::users::user::lookup_user_for_login_result::VecBytes`,\n password_version,\n is_banned,\n maybe_feature_flags\nFROM users\nWHERE email_address = ?\nLIMIT 1\n ",
|
||||
"query": "\nSELECT\n token as `token: tokens::tokens::users::UserToken`,\n username,\n display_name,\n username_is_not_customized,\n email_address,\n password_hash as `password_hash: crate::queries::users::user::get::lookup_user_for_login_result::VecBytes`,\n password_version,\n is_banned,\n maybe_feature_flags\nFROM users\nWHERE email_address = ?\nLIMIT 1\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -25,6 +25,26 @@
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "display_name",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
|
||||
"char_set": 224,
|
||||
"max_size": 80
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "username_is_not_customized",
|
||||
"type_info": {
|
||||
"type": "Tiny",
|
||||
"flags": "NOT_NULL",
|
||||
"char_set": 63,
|
||||
"max_size": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "email_address",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -34,8 +54,8 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "password_hash: crate::queries::users::user::lookup_user_for_login_result::VecBytes",
|
||||
"ordinal": 5,
|
||||
"name": "password_hash: crate::queries::users::user::get::lookup_user_for_login_result::VecBytes",
|
||||
"type_info": {
|
||||
"type": "String",
|
||||
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
|
||||
@@ -44,7 +64,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"ordinal": 6,
|
||||
"name": "password_version",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
@@ -54,7 +74,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"ordinal": 7,
|
||||
"name": "is_banned",
|
||||
"type_info": {
|
||||
"type": "Tiny",
|
||||
@@ -64,7 +84,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"ordinal": 8,
|
||||
"name": "maybe_feature_flags",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -84,8 +104,10 @@
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "48889cc9c9b8dbe482e74687629a6958c1c9bf8a1cd5ae177afea0ad0709736d"
|
||||
"hash": "a5b0ee8755f5bd81dc330e63fa8a1c02e6397e7914f4041d90b2bc9cfc249c17"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nINSERT INTO tags\nSET\n token = ?,\n tag_value = ?\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "c7e848e4c906a34ac5a4ad8cc73354baa8d5cd81170dd06d66d7f414505d538b"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nUPDATE google_sign_in_accounts\nSET\n email_address = ?,\n is_email_verified = ?,\n\n maybe_locale = ?,\n\n maybe_name = ?,\n maybe_given_name = ?,\n maybe_family_name = ?,\n\n ip_address_update = ?,\n\n version = version + 1\nWHERE\n subject = ?\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 8
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "cf30aa779c25b42e51b38f7301c7a1b19e5586a10d21fad5bf05e4edde481a65"
|
||||
}
|
||||
+45
-23
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nSELECT\n w.id,\n w.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n\n w.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n w.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n w.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n\n w.title,\n\n cover_image.token as `maybe_cover_image_media_file_token: tokens::tokens::media_files::MediaFileToken`,\n cover_image.public_bucket_directory_hash as maybe_cover_image_public_bucket_hash,\n cover_image.maybe_public_bucket_prefix as maybe_cover_image_public_bucket_prefix,\n cover_image.maybe_public_bucket_extension as maybe_cover_image_public_bucket_extension,\n\n w.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash as creator_gravatar_hash,\n\n featured_items.entity_token IS NOT NULL AS is_featured,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n\n w.cached_usage_count,\n\n extension_tts.ietf_language_tag as maybe_tts_ietf_language_tag,\n extension_tts.ietf_primary_language_subtag as maybe_tts_ietf_primary_language_subtag,\n\n extension_vc.ietf_language_tag as maybe_vc_ietf_language_tag,\n extension_vc.ietf_primary_language_subtag as maybe_vc_ietf_primary_language_subtag,\n\n w.created_at,\n w.updated_at,\n w.user_deleted_at,\n w.mod_deleted_at,\n\n NOW() as database_read_time\n\nFROM model_weights as w\n\nJOIN users\n ON users.token = w.creator_user_token\n\nLEFT OUTER JOIN model_weights_extension_tts_details as extension_tts\n ON extension_tts.model_weights_token = w.token\nLEFT OUTER JOIN model_weights_extension_voice_conversion_details as extension_vc\n ON extension_vc.model_weights_token = w.token\nLEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"model_weight\"\n AND entity_stats.entity_token = w.token\nLEFT OUTER JOIN media_files as cover_image\n ON cover_image.token = w.maybe_cover_image_media_file_token\nLEFT OUTER JOIN featured_items\n ON featured_items.entity_type = \"model_weight\"\n AND featured_items.entity_token = w.token\n AND featured_items.deleted_at IS NULL\n\nWHERE\n w.id > ?\nORDER BY id ASC\nLIMIT ?\n ",
|
||||
"query": "\nSELECT\n w.id,\n w.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n\n w.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n w.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n w.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n\n w.title,\n\n w.maybe_ietf_language_tag,\n w.maybe_ietf_primary_language_subtag,\n\n cover_image.token as `maybe_cover_image_media_file_token: tokens::tokens::media_files::MediaFileToken`,\n cover_image.public_bucket_directory_hash as maybe_cover_image_public_bucket_hash,\n cover_image.maybe_public_bucket_prefix as maybe_cover_image_public_bucket_prefix,\n cover_image.maybe_public_bucket_extension as maybe_cover_image_public_bucket_extension,\n\n w.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash as creator_gravatar_hash,\n\n featured_items.entity_token IS NOT NULL AS is_featured,\n\n entity_stats.ratings_positive_count as maybe_ratings_positive_count,\n entity_stats.ratings_negative_count as maybe_ratings_negative_count,\n entity_stats.bookmark_count as maybe_bookmark_count,\n\n w.cached_usage_count,\n\n extension_tts.ietf_language_tag as maybe_tts_ietf_language_tag,\n extension_tts.ietf_primary_language_subtag as maybe_tts_ietf_primary_language_subtag,\n\n extension_vc.ietf_language_tag as maybe_vc_ietf_language_tag,\n extension_vc.ietf_primary_language_subtag as maybe_vc_ietf_primary_language_subtag,\n\n w.created_at,\n w.updated_at,\n w.user_deleted_at,\n w.mod_deleted_at,\n\n NOW() as database_read_time\n\nFROM model_weights as w\n\nJOIN users\n ON users.token = w.creator_user_token\n\nLEFT OUTER JOIN model_weights_extension_tts_details as extension_tts\n ON extension_tts.model_weights_token = w.token\nLEFT OUTER JOIN model_weights_extension_voice_conversion_details as extension_vc\n ON extension_vc.model_weights_token = w.token\nLEFT OUTER JOIN entity_stats\n ON entity_stats.entity_type = \"model_weight\"\n AND entity_stats.entity_token = w.token\nLEFT OUTER JOIN media_files as cover_image\n ON cover_image.token = w.maybe_cover_image_media_file_token\nLEFT OUTER JOIN featured_items\n ON featured_items.entity_type = \"model_weight\"\n AND featured_items.entity_token = w.token\n AND featured_items.deleted_at IS NULL\n\nWHERE\n w.id > ?\nORDER BY id ASC\nLIMIT ?\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -65,6 +65,26 @@
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "maybe_ietf_language_tag",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "BINARY",
|
||||
"char_set": 224,
|
||||
"max_size": 256
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "maybe_ietf_primary_language_subtag",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "BINARY",
|
||||
"char_set": 224,
|
||||
"max_size": 48
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "maybe_cover_image_media_file_token: tokens::tokens::media_files::MediaFileToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -74,7 +94,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"ordinal": 9,
|
||||
"name": "maybe_cover_image_public_bucket_hash",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -84,7 +104,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"ordinal": 10,
|
||||
"name": "maybe_cover_image_public_bucket_prefix",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -94,7 +114,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"ordinal": 11,
|
||||
"name": "maybe_cover_image_public_bucket_extension",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -104,7 +124,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"ordinal": 12,
|
||||
"name": "creator_user_token: tokens::tokens::users::UserToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -114,7 +134,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 11,
|
||||
"ordinal": 13,
|
||||
"name": "creator_username",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -124,7 +144,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 12,
|
||||
"ordinal": 14,
|
||||
"name": "creator_display_name",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -134,7 +154,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 13,
|
||||
"ordinal": 15,
|
||||
"name": "creator_gravatar_hash",
|
||||
"type_info": {
|
||||
"type": "String",
|
||||
@@ -144,7 +164,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 14,
|
||||
"ordinal": 16,
|
||||
"name": "is_featured",
|
||||
"type_info": {
|
||||
"type": "LongLong",
|
||||
@@ -154,7 +174,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 15,
|
||||
"ordinal": 17,
|
||||
"name": "maybe_ratings_positive_count",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
@@ -164,7 +184,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 16,
|
||||
"ordinal": 18,
|
||||
"name": "maybe_ratings_negative_count",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
@@ -174,7 +194,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 17,
|
||||
"ordinal": 19,
|
||||
"name": "maybe_bookmark_count",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
@@ -184,7 +204,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 18,
|
||||
"ordinal": 20,
|
||||
"name": "cached_usage_count",
|
||||
"type_info": {
|
||||
"type": "LongLong",
|
||||
@@ -194,7 +214,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 19,
|
||||
"ordinal": 21,
|
||||
"name": "maybe_tts_ietf_language_tag",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -204,7 +224,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 20,
|
||||
"ordinal": 22,
|
||||
"name": "maybe_tts_ietf_primary_language_subtag",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -214,7 +234,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 21,
|
||||
"ordinal": 23,
|
||||
"name": "maybe_vc_ietf_language_tag",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -224,7 +244,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 22,
|
||||
"ordinal": 24,
|
||||
"name": "maybe_vc_ietf_primary_language_subtag",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
@@ -234,7 +254,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 23,
|
||||
"ordinal": 25,
|
||||
"name": "created_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
@@ -244,7 +264,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 24,
|
||||
"ordinal": 26,
|
||||
"name": "updated_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
@@ -254,7 +274,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 25,
|
||||
"ordinal": 27,
|
||||
"name": "user_deleted_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
@@ -264,7 +284,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 26,
|
||||
"ordinal": 28,
|
||||
"name": "mod_deleted_at",
|
||||
"type_info": {
|
||||
"type": "Timestamp",
|
||||
@@ -274,7 +294,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 27,
|
||||
"ordinal": 29,
|
||||
"name": "database_read_time",
|
||||
"type_info": {
|
||||
"type": "Datetime",
|
||||
@@ -298,6 +318,8 @@
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
@@ -318,5 +340,5 @@
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "4bce2b10f0510feca7f5705049a5c0eaae6e1a840146628495827468a38c05dd"
|
||||
"hash": "d0f9d2cf4176c3f7f8fbff66eb6ff9415d989afc2b5944629a7bcea4b5a822f3"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nINSERT INTO google_sign_in_accounts\nSET\n token = ?,\n subject = ?,\n\n maybe_user_token = ?,\n\n email_address = ?,\n is_email_verified = ?,\n\n maybe_locale = ?,\n\n maybe_name = ?,\n maybe_given_name = ?,\n maybe_family_name = ?,\n\n ip_address_creation = ?,\n ip_address_update = ?\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 11
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "e034a43787bce2ac2db23dee2e640d527f82b29133d29a3d3803aab905f9cab6"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nUPDATE users\nSET\n username = ?,\n display_name = ?,\n username_is_not_customized = ?,\n ip_address_last_update = ?,\n version = version + 1\nWHERE\n token = ?\nLIMIT 1\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 5
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "f41980bd0f7e5ba680315095c773b406e589ea6e72b5c284a14440c5d1c57811"
|
||||
}
|
||||
Generated
+1409
-1130
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -3,8 +3,6 @@ resolver = "2"
|
||||
|
||||
members = [
|
||||
# Types: common strongly-typed tokens, ids, payloads, etc.
|
||||
# Also common cloud buckets and other "strongly typed" configs.
|
||||
"crates/_types/buckets",
|
||||
"crates/_types/composite_identifiers",
|
||||
"crates/_types/enums",
|
||||
"crates/_types/enums_public",
|
||||
@@ -28,8 +26,10 @@ members = [
|
||||
"crates/lib/actix_helpers",
|
||||
"crates/lib/api_clients/cloud_storage",
|
||||
"crates/lib/api_clients/google_drive_common",
|
||||
"crates/lib/api_clients/google_sign_in",
|
||||
"crates/lib/api_clients/thumbnail_generator",
|
||||
"crates/lib/bootstrap",
|
||||
"crates/lib/bucket_paths",
|
||||
"crates/lib/caching/memory_caching",
|
||||
"crates/lib/caching/redis_caching",
|
||||
"crates/lib/concurrency",
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
-- User sign up histogram by method
|
||||
-- Since we don't have an index on created_at, we threshold by id
|
||||
-- Current ID count = 7578799 (September 28, 2024)
|
||||
select
|
||||
date(created_at) as date,
|
||||
case
|
||||
when maybe_signup_method is null then 'email_password'
|
||||
else maybe_signup_method
|
||||
end as method,
|
||||
count(*) as signup_count
|
||||
from users
|
||||
where id > 7200000
|
||||
and created_at >= NOW() - INTERVAL 60 DAY
|
||||
group by date(created_at), method
|
||||
@@ -0,0 +1,14 @@
|
||||
-- User sign up histogram by method
|
||||
-- Since we don't have an index on created_at, we threshold by id
|
||||
-- Current ID count = 7578799 (September 28, 2024)
|
||||
select
|
||||
date(created_at) as date,
|
||||
case
|
||||
when maybe_source is null then 'unknown'
|
||||
else maybe_source
|
||||
end as source,
|
||||
count(*) as signup_count
|
||||
from users
|
||||
where id > 7200000
|
||||
and created_at >= NOW() - INTERVAL 60 DAY
|
||||
group by date(created_at), maybe_source
|
||||
@@ -7,6 +7,14 @@ select count(*)
|
||||
from generic_inference_jobs
|
||||
where status = 'pending';
|
||||
|
||||
-- Get pending job count by job type
|
||||
select
|
||||
job_type,
|
||||
count(*)
|
||||
from generic_inference_jobs
|
||||
where status = 'pending'
|
||||
group by job_type;
|
||||
|
||||
-- Kill *ALL* pending / outstanding jobs of any type
|
||||
update generic_inference_jobs
|
||||
set status = 'dead'
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
-- Find old stale jobs
|
||||
select
|
||||
job_type,
|
||||
count(*)
|
||||
from generic_inference_jobs
|
||||
where status = 'started'
|
||||
and created_at < (CURDATE() - INTERVAL 30 MINUTE)
|
||||
group by job_type;
|
||||
|
||||
-- Kill old stale jobs
|
||||
update generic_inference_jobs
|
||||
set status = 'dead'
|
||||
where status = 'started'
|
||||
and created_at < (CURDATE() - INTERVAL 30 MINUTE)
|
||||
|
||||
-- Check up on recent jobs after purge
|
||||
select
|
||||
job_type,
|
||||
count(*)
|
||||
from generic_inference_jobs
|
||||
where status = 'started'
|
||||
group by job_type;
|
||||
|
||||
-- Kill old pending jobs too
|
||||
update generic_inference_jobs
|
||||
set status = 'dead'
|
||||
where status = 'pending'
|
||||
and created_at < (CURDATE() - INTERVAL 30 MINUTE)
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
|
||||
-- Select popular models without cover images or language
|
||||
select
|
||||
mw.token,
|
||||
mw.title,
|
||||
mw.maybe_ietf_language_tag,
|
||||
mw.maybe_cover_image_media_file_token,
|
||||
count(*) as use_count
|
||||
from generic_inference_jobs as gij
|
||||
left outer join model_weights as mw
|
||||
on gij.maybe_model_token = mw.token
|
||||
where gij.created_at >= (CURDATE() - INTERVAL 5 DAY)
|
||||
and (
|
||||
mw.maybe_ietf_language_tag IS NULL
|
||||
or mw.maybe_cover_image_media_file_token IS NULL
|
||||
)
|
||||
and mw.mod_deleted_at IS NULL
|
||||
and mw.user_deleted_at IS NULL
|
||||
group by
|
||||
mw.token,
|
||||
mw.title,
|
||||
mw.maybe_ietf_language_tag,
|
||||
mw.maybe_cover_image_media_file_token
|
||||
order by use_count desc
|
||||
limit 100;
|
||||
|
||||
|
||||
-- Select popular models without streamer usage distorting the totals
|
||||
select
|
||||
mw.token,
|
||||
mw.title,
|
||||
mw.maybe_ietf_language_tag,
|
||||
mw.maybe_cover_image_media_file_token,
|
||||
count(*) as use_count
|
||||
from generic_inference_jobs as gij
|
||||
left outer join model_weights as mw
|
||||
on gij.maybe_model_token = mw.token
|
||||
where gij.created_at >= (CURDATE() - INTERVAL 5 DAY)
|
||||
and (
|
||||
mw.maybe_ietf_language_tag IS NULL
|
||||
or mw.maybe_cover_image_media_file_token IS NULL
|
||||
)
|
||||
and mw.mod_deleted_at IS NULL
|
||||
and mw.user_deleted_at IS NULL
|
||||
and gij.maybe_creator_user_token NOT IN (
|
||||
-- This subquery returns streamers that generated over a certain threshold number of results
|
||||
select
|
||||
user_token
|
||||
from (
|
||||
select
|
||||
u.token as user_token,
|
||||
count(*) as generations
|
||||
from generic_inference_jobs as gij
|
||||
join users as u
|
||||
on gij.maybe_creator_user_token = u.token
|
||||
where gij.created_at >= (CURDATE() - INTERVAL 5 DAY)
|
||||
and gij.maybe_creator_user_token is not null
|
||||
group by user_token
|
||||
order by generations desc
|
||||
) as top_users
|
||||
where top_users.generations > 300
|
||||
)
|
||||
group by
|
||||
mw.token,
|
||||
mw.title,
|
||||
mw.maybe_ietf_language_tag,
|
||||
mw.maybe_cover_image_media_file_token
|
||||
order by use_count desc
|
||||
limit 50;
|
||||
@@ -0,0 +1,5 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
DROP TABLE google_sign_in_accounts;
|
||||
@@ -0,0 +1,90 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
-- Google SSO / "Sign in with Google" data
|
||||
-- Many of the values come from OpenID Connect:
|
||||
-- https://developers.google.com/identity/openid-connect/openid-connect
|
||||
CREATE TABLE google_sign_in_accounts(
|
||||
-- Not used for anything except replication.
|
||||
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
|
||||
-- Effective "primary key" (PUBLIC)
|
||||
token VARCHAR(32) NOT NULL,
|
||||
|
||||
-- An identifier for the user, unique among all Google accounts and never reused.
|
||||
-- A Google account can have multiple email addresses at different points in time, but the sub
|
||||
-- value is never changed. Use sub within your application as the unique-identifier key for the
|
||||
-- user. Maximum length of 255 case-sensitive ASCII characters.
|
||||
--
|
||||
-- https://developers.google.com/identity/openid-connect/openid-connect#an-id-tokens-payload
|
||||
--
|
||||
-- Subject Identifier. A locally unique and never reassigned identifier within
|
||||
-- the Issuer for the End-User, which is intended to be consumed by the Client, e.g., 24400320
|
||||
-- or AItOawmwtWwcT0k51BayewNvutrJUqsvl6qs7A4. It MUST NOT exceed 255 ASCII characters in
|
||||
-- length. The sub value is a case sensitive string."
|
||||
--
|
||||
-- https://stackoverflow.com/a/72091170
|
||||
-- https://stackoverflow.com/a/74003331
|
||||
--
|
||||
subject VARCHAR(255) NOT NULL,
|
||||
|
||||
-- ========== FOREIGN KEYS ==========
|
||||
|
||||
-- Foreign key link to the users table record.
|
||||
-- This could be removed later if a user disassociates their account.
|
||||
maybe_user_token VARCHAR(32) DEFAULT NULL,
|
||||
|
||||
-- ========== OTHER INFO ==========
|
||||
|
||||
-- The user's email address. Provided only if you included the email scope in your request.
|
||||
-- The value of this claim may not be unique to this account and could change over time,
|
||||
-- therefore you should not use this value as the primary identifier to link to your user record.
|
||||
-- You also can't rely on the domain of the email claim to identify users of Google Workspace or
|
||||
-- Cloud organizations; use the hd claim instead.
|
||||
--
|
||||
-- NB: If this is null, we'll simply deny the sign in / sign up event. So effectively, our copy
|
||||
-- will never be null.
|
||||
email_address VARCHAR(255) NOT NULL,
|
||||
|
||||
-- True if the user's e-mail address has been verified; otherwise false.
|
||||
is_email_verified BOOLEAN NOT NULL DEFAULT false,
|
||||
|
||||
-- The user's locale, represented by a BCP 47 language tag.
|
||||
-- Might be provided when a name claim is present.
|
||||
maybe_locale VARCHAR(255) DEFAULT NULL,
|
||||
|
||||
-- The user's full name, in a displayable form. Might be provided when: [...]
|
||||
maybe_name VARCHAR(255) DEFAULT NULL,
|
||||
|
||||
-- The user's given name(s) or first name(s). Might be provided when a name claim is present.
|
||||
maybe_given_name VARCHAR(255) DEFAULT NULL,
|
||||
|
||||
-- The user's surname(s) or last name(s). Might be provided when a name claim is present.
|
||||
maybe_family_name VARCHAR(255) DEFAULT NULL,
|
||||
|
||||
-- For abuse tracking.
|
||||
-- Wide enough for IPv4/6
|
||||
ip_address_creation VARCHAR(40) NOT NULL,
|
||||
ip_address_update VARCHAR(40) NOT NULL,
|
||||
|
||||
-- ========== VECTOR CLOCK ==========
|
||||
|
||||
-- Incremented with every update.
|
||||
version INT NOT NULL DEFAULT 0,
|
||||
|
||||
-- ========== TIMESTAMPS ==========
|
||||
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
|
||||
-- INDICES --
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY (token),
|
||||
UNIQUE KEY (subject),
|
||||
KEY index_maybe_user_token (maybe_user_token),
|
||||
KEY index_email_address (email_address),
|
||||
KEY index_created_at (created_at),
|
||||
KEY index_updated_at (updated_at)
|
||||
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
|
||||
@@ -0,0 +1,5 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE users DROP COLUMN email_confirmed_by_google;
|
||||
@@ -0,0 +1,8 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE users
|
||||
ADD COLUMN
|
||||
email_confirmed_by_google BOOLEAN NOT NULL DEFAULT false
|
||||
AFTER email_confirmed;
|
||||
@@ -0,0 +1,5 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE users DROP COLUMN is_without_password;
|
||||
@@ -0,0 +1,8 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE users
|
||||
ADD COLUMN
|
||||
is_without_password BOOLEAN NOT NULL DEFAULT false
|
||||
AFTER password_version;
|
||||
@@ -0,0 +1,5 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE users DROP COLUMN maybe_signup_method;
|
||||
@@ -0,0 +1,8 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE users
|
||||
ADD COLUMN
|
||||
maybe_signup_method VARCHAR(32) DEFAULT NULL
|
||||
AFTER maybe_source;
|
||||
@@ -0,0 +1,5 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE users DROP COLUMN username_is_generated;
|
||||
@@ -0,0 +1,8 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE users
|
||||
ADD COLUMN
|
||||
username_is_generated BOOLEAN NOT NULL DEFAULT false
|
||||
AFTER display_name;
|
||||
@@ -0,0 +1,5 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE users DROP COLUMN username_is_not_customized;
|
||||
@@ -0,0 +1,8 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE users
|
||||
ADD COLUMN
|
||||
username_is_not_customized BOOLEAN NOT NULL DEFAULT false
|
||||
AFTER username_is_generated;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE model_weights DROP COLUMN maybe_ietf_language_tag;
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE model_weights
|
||||
ADD COLUMN
|
||||
maybe_ietf_language_tag VARCHAR(64) DEFAULT NULL
|
||||
AFTER maybe_description_rendered_html;
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE model_weights DROP COLUMN maybe_ietf_primary_language_subtag;
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
ALTER TABLE model_weights
|
||||
ADD COLUMN
|
||||
maybe_ietf_primary_language_subtag VARCHAR(12) DEFAULT NULL
|
||||
AFTER maybe_ietf_language_tag;
|
||||
|
||||
@@ -53,6 +53,22 @@ CREATE TABLE model_weights (
|
||||
-- models don't deserve a description).
|
||||
maybe_description_rendered_html TEXT DEFAULT NULL,
|
||||
|
||||
-- OPTIONAL. Only for TTS and Voice Conversion models.
|
||||
-- The full IETF BCP47 language tag (eg. en, en-US, es-419, ja-JP, pt, etc.)
|
||||
-- (Not that it matters apart from categorization, since voice conversion is universal.)
|
||||
-- NB: There's another set of tables (model_weights_extension_voice_conversion_details, etc.) that
|
||||
-- may have older post-migration data for some models. We'll want to backfill this field from there
|
||||
-- and then make this one authoritative.
|
||||
maybe_ietf_language_tag VARCHAR(64) DEFAULT NULL,
|
||||
|
||||
-- OPTIONAL. Only for TTS and Voice Conversion models.
|
||||
-- The IETF BCP47 language tag's primary language subtag (eg. "es-419" becomes "es")
|
||||
-- (Not that it matters apart from categorization, since voice conversion is universal.)
|
||||
-- NB: There's another set of tables (model_weights_extension_voice_conversion_details, etc.) that
|
||||
-- may have older post-migration data for some models. We'll want to backfill this field from there
|
||||
-- and then make this one authoritative.
|
||||
maybe_ietf_primary_language_subtag VARCHAR(12) DEFAULT NULL,
|
||||
|
||||
|
||||
-- ========== CREATOR DETAILS ==========
|
||||
|
||||
|
||||
@@ -16,9 +16,29 @@ CREATE TABLE users (
|
||||
username VARCHAR(20) NOT NULL,
|
||||
display_name VARCHAR(20) NOT NULL,
|
||||
|
||||
-- If the username the user currently has was automatically generated by our
|
||||
-- system rather than manually entered. If the user selects the username we
|
||||
-- made for them, we still leave this as true.
|
||||
username_is_generated BOOLEAN NOT NULL DEFAULT false,
|
||||
|
||||
-- Users with new randomly generated usernames have this flag set to true.
|
||||
-- If a user then changes their username from the default, we set this to false.
|
||||
-- Or if a user elects that the random username we generated for them is fine,
|
||||
-- we also set this to false.
|
||||
username_is_not_customized BOOLEAN NOT NULL DEFAULT false,
|
||||
|
||||
-- Set by the user at sign up:
|
||||
-- - When email + password signup, this is the email provided.
|
||||
-- - When Google SSO, this is the email provided by Google.
|
||||
email_address VARCHAR(255) NOT NULL,
|
||||
|
||||
-- Email address is confirmed by us.
|
||||
-- We do not set this on 3rd party (ie. Google) "email confirmation", only our own.
|
||||
email_confirmed BOOLEAN NOT NULL DEFAULT false,
|
||||
|
||||
-- Email address is confirmed by Google.
|
||||
email_confirmed_by_google BOOLEAN NOT NULL DEFAULT false,
|
||||
|
||||
-- The role assigned to the user confers permissions.
|
||||
user_role_slug VARCHAR(16) NOT NULL,
|
||||
|
||||
@@ -65,6 +85,9 @@ CREATE TABLE users (
|
||||
-- Incremented with every update to the password.
|
||||
password_version INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
|
||||
-- Users signing up from SSO do not have a password at time of account creation.
|
||||
is_without_password BOOLEAN NOT NULL DEFAULT false,
|
||||
|
||||
-- ========== ABUSE TRACKING ==========
|
||||
|
||||
-- For abuse tracking.
|
||||
@@ -162,11 +185,16 @@ CREATE TABLE users (
|
||||
|
||||
-- ========== TRACKING ==========
|
||||
|
||||
-- Where the user signed up from
|
||||
-- Where the user signed up from (NOT NECESSARILY AN ENUM!)
|
||||
-- For now this will be "fakeyou" and "storyteller", but we may extend
|
||||
-- or overload this to handle other cases or metadata.
|
||||
maybe_source VARCHAR(255) DEFAULT NULL,
|
||||
|
||||
-- How users created their account
|
||||
-- Initially this will be "email_password" or "google_sign_in"
|
||||
-- Older users do not have a value and are assumed to be "email_sign_in"
|
||||
maybe_signup_method VARCHAR(16) DEFAULT NULL,
|
||||
|
||||
-- ========== MODERATION DETAILS ==========
|
||||
|
||||
-- Different than deleted.
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
//! buckets
|
||||
//!
|
||||
//! The purpose of this library is to maintain strongly typed cloud storage buckets
|
||||
//! that can be shared between projects.
|
||||
//!
|
||||
|
||||
// Never allow these
|
||||
#![forbid(private_bounds)]
|
||||
#![forbid(private_interfaces)]
|
||||
#![forbid(unused_must_use)] // NB: It's unsafe to not close/check some things
|
||||
|
||||
// Okay to toggle
|
||||
#![forbid(unreachable_patterns)]
|
||||
// #![forbid(unused_imports)]
|
||||
#![forbid(unused_mut)]
|
||||
#![forbid(unused_variables)]
|
||||
|
||||
// Always allow
|
||||
#![allow(dead_code)]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
pub mod util;
|
||||
|
||||
pub mod private;
|
||||
pub mod public;
|
||||
@@ -1,2 +0,0 @@
|
||||
pub mod hashed_directory_path_long_string;
|
||||
pub mod hashed_directory_path_short_string;
|
||||
@@ -27,9 +27,9 @@ my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
serde = "1.0.125"
|
||||
serde_derive = "1.0.125"
|
||||
|
||||
sqlx = { version = "0.8.2", features = [ "mysql", "sqlite", "runtime-tokio-native-tls", "chrono" ] }
|
||||
sqlx-core = { version = "0.8.2" }
|
||||
sqlx-mysql= { version = "0.8.2" }
|
||||
sqlx = { version = "0.7.2", features = [ "mysql", "sqlite", "runtime-tokio-native-tls", "chrono" ] }
|
||||
sqlx-core = { version = "0.7.2" }
|
||||
sqlx-mysql= { version = "0.7.2" }
|
||||
|
||||
utoipa = { version = "4", features = ["chrono","actix_extras"] }
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
pub mod audit_logs;
|
||||
pub mod batch_generations;
|
||||
pub mod featured_items;
|
||||
pub mod tag_uses;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
pub mod tag_use_entity;
|
||||
@@ -0,0 +1,40 @@
|
||||
use enums::by_table::tag_uses::tag_use_entity_type::TagUseEntityType;
|
||||
use tokens::tokens::media_files::MediaFileToken;
|
||||
use tokens::tokens::model_weights::ModelWeightToken;
|
||||
|
||||
// TODO(bt, 2024-01-16): A ref type with <'a> lifetime of inner data instead of ownership?
|
||||
pub enum TagUseEntity {
|
||||
MediaFile(MediaFileToken),
|
||||
ModelWeight(ModelWeightToken),
|
||||
}
|
||||
|
||||
// TODO(bt, 2024-01-16): Codegen? Make traits for these? Maybe overkill.
|
||||
impl TagUseEntity {
|
||||
pub fn from_entity_type_and_token(entity_type: TagUseEntityType, token: &str) -> Self {
|
||||
match entity_type {
|
||||
TagUseEntityType::ModelWeight => Self::ModelWeight(ModelWeightToken::new_from_str(token)),
|
||||
TagUseEntityType::MediaFile => Self::MediaFile(MediaFileToken::new_from_str(token)),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_entity_type(&self) -> TagUseEntityType {
|
||||
match self {
|
||||
Self::MediaFile(_) => TagUseEntityType::MediaFile,
|
||||
Self::ModelWeight(_) => TagUseEntityType::ModelWeight,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_entity_token_str(&self) -> &str {
|
||||
match self {
|
||||
Self::MediaFile(token) => token.as_str(),
|
||||
Self::ModelWeight(token) => token.as_str(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_composite_keys(&self) -> (TagUseEntityType, &str) {
|
||||
match self {
|
||||
Self::MediaFile(token) => (TagUseEntityType::MediaFile, token.as_str()),
|
||||
Self::ModelWeight(token) => (TagUseEntityType::ModelWeight, token.as_str()),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,9 +25,9 @@ my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
serde = "1.0.125"
|
||||
serde_derive = "1.0.125"
|
||||
|
||||
sqlx = { version = "0.8.2", features = [ "mysql", "sqlite", "runtime-tokio-native-tls", "chrono" ] }
|
||||
sqlx-core = { version = "0.8.2" }
|
||||
sqlx-mysql= { version = "0.8.2" }
|
||||
sqlx = { version = "0.7.2", features = [ "mysql", "sqlite", "runtime-tokio-native-tls", "chrono" ] }
|
||||
sqlx-core = { version = "0.7.2" }
|
||||
sqlx-mysql= { version = "0.7.2" }
|
||||
|
||||
utoipa = { version = "4", features = ["chrono","actix_extras"] }
|
||||
|
||||
@@ -39,7 +39,3 @@ strum = { version = "0.26", features = ["derive"] }
|
||||
# Test serialization
|
||||
serde_json = "1.0.108"
|
||||
toml = "0.8.14"
|
||||
|
||||
# Temporary for a test
|
||||
errors = { path = "../../lib/errors" }
|
||||
chrono = { version = "0.4.22", features = ["serde"] }
|
||||
|
||||
@@ -57,6 +57,9 @@ pub enum InferenceCategory {
|
||||
#[serde(rename = "live_portrait")]
|
||||
LivePortrait,
|
||||
|
||||
#[serde(rename="seed_vc")]
|
||||
SeedVc,
|
||||
|
||||
/// DEPRECATED. Do not use.
|
||||
/// This was for ReRenderAVideo, which we never productionized.
|
||||
#[deprecated(note = "This was for ReRenderAVideo, which we never productionized.")]
|
||||
@@ -67,6 +70,9 @@ pub enum InferenceCategory {
|
||||
#[deprecated(note = "This was for Bevy engine's server side rendering.")]
|
||||
#[serde(rename = "convert_bvh_to_workflow")]
|
||||
ConvertBvhToWorkflow,
|
||||
|
||||
#[serde(rename = "f5_tts")]
|
||||
F5TTS,
|
||||
}
|
||||
|
||||
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
|
||||
@@ -85,8 +91,10 @@ impl InferenceCategory {
|
||||
Self::ImageGeneration => "image_generation",
|
||||
Self::Mocap => "mocap",
|
||||
Self::Workflow => "workflow",
|
||||
Self::F5TTS => "f5_tts",
|
||||
Self::FormatConversion => "format_conversion",
|
||||
Self::LivePortrait => "live_portrait",
|
||||
Self::SeedVc => "seed_vc",
|
||||
Self::VideoFilter => "video_filter",
|
||||
Self::ConvertBvhToWorkflow => "convert_bvh_to_workflow",
|
||||
}
|
||||
@@ -99,10 +107,12 @@ impl InferenceCategory {
|
||||
"text_to_speech" => Ok(Self::TextToSpeech),
|
||||
"voice_conversion" => Ok(Self::VoiceConversion),
|
||||
"image_generation" => Ok(Self::ImageGeneration),
|
||||
"f5_tts" => Ok(Self::F5TTS),
|
||||
"mocap" => Ok(Self::Mocap),
|
||||
"workflow" => Ok(Self::Workflow),
|
||||
"format_conversion" => Ok(Self::FormatConversion),
|
||||
"live_portrait" => Ok(Self::LivePortrait),
|
||||
"seed_vc" => Ok(Self::SeedVc),
|
||||
"video_filter" => Ok(Self::VideoFilter),
|
||||
"convert_bvh_to_workflow" => Ok(Self::ConvertBvhToWorkflow),
|
||||
_ => Err(format!("invalid value: {:?}", value)),
|
||||
@@ -119,6 +129,8 @@ impl InferenceCategory {
|
||||
Self::VoiceConversion,
|
||||
Self::ImageGeneration,
|
||||
Self::Mocap,
|
||||
Self::F5TTS,
|
||||
Self::SeedVc,
|
||||
Self::Workflow,
|
||||
Self::FormatConversion,
|
||||
Self::LivePortrait,
|
||||
@@ -144,6 +156,8 @@ mod tests {
|
||||
assert_serialization(InferenceCategory::VoiceConversion, "voice_conversion");
|
||||
assert_serialization(InferenceCategory::ImageGeneration, "image_generation");
|
||||
assert_serialization(InferenceCategory::Mocap, "mocap");
|
||||
assert_serialization(InferenceCategory::F5TTS, "f5_tts");
|
||||
assert_serialization(InferenceCategory::SeedVc, "seed_vc");
|
||||
assert_serialization(InferenceCategory::Workflow, "workflow");
|
||||
assert_serialization(InferenceCategory::FormatConversion, "format_conversion");
|
||||
assert_serialization(InferenceCategory::LivePortrait, "live_portrait");
|
||||
@@ -158,6 +172,8 @@ mod tests {
|
||||
assert_eq!(InferenceCategory::TextToSpeech.to_str(), "text_to_speech");
|
||||
assert_eq!(InferenceCategory::VoiceConversion.to_str(), "voice_conversion");
|
||||
assert_eq!(InferenceCategory::ImageGeneration.to_str(), "image_generation");
|
||||
assert_eq!(InferenceCategory::F5TTS.to_str(), "f5_tts");
|
||||
assert_eq!(InferenceCategory::SeedVc.to_str(), "seed_vc");
|
||||
assert_eq!(InferenceCategory::Mocap.to_str(), "mocap");
|
||||
assert_eq!(InferenceCategory::Workflow.to_str(), "workflow");
|
||||
assert_eq!(InferenceCategory::FormatConversion.to_str(), "format_conversion");
|
||||
@@ -173,6 +189,8 @@ mod tests {
|
||||
assert_eq!(InferenceCategory::from_str("text_to_speech").unwrap(), InferenceCategory::TextToSpeech);
|
||||
assert_eq!(InferenceCategory::from_str("voice_conversion").unwrap(), InferenceCategory::VoiceConversion);
|
||||
assert_eq!(InferenceCategory::from_str("image_generation").unwrap(), InferenceCategory::ImageGeneration);
|
||||
assert_eq!(InferenceCategory::from_str("f5_tts").unwrap(), InferenceCategory::F5TTS);
|
||||
assert_eq!(InferenceCategory::from_str("seed_vc").unwrap(), InferenceCategory::SeedVc);
|
||||
assert_eq!(InferenceCategory::from_str("mocap").unwrap(), InferenceCategory::Mocap);
|
||||
assert_eq!(InferenceCategory::from_str("workflow").unwrap(), InferenceCategory::Workflow);
|
||||
assert_eq!(InferenceCategory::from_str("format_conversion").unwrap(), InferenceCategory::FormatConversion);
|
||||
@@ -185,13 +203,15 @@ mod tests {
|
||||
fn all_variants() {
|
||||
// Static check
|
||||
let mut variants = InferenceCategory::all_variants();
|
||||
assert_eq!(variants.len(), 11);
|
||||
assert_eq!(variants.len(), 12);
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::DeprecatedField));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::LipsyncAnimation));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::TextToSpeech));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::VoiceConversion));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::ImageGeneration));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::F5TTS));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::Mocap));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::SeedVc));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::Workflow));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::FormatConversion));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::LivePortrait));
|
||||
|
||||
+27
-1
@@ -27,6 +27,9 @@ pub enum InferenceJobProductCategory {
|
||||
/// TTS: GptSoVits
|
||||
TtsGptSoVits,
|
||||
|
||||
/// TTS: F5Tts (Zero Shot)
|
||||
TtsF5,
|
||||
|
||||
/// TTS: StyleTts2 (Zero Shot)
|
||||
TtsStyleTts2,
|
||||
|
||||
@@ -41,6 +44,8 @@ pub enum InferenceJobProductCategory {
|
||||
/// Voice Conversion: SoVitsSvc
|
||||
VcSvc,
|
||||
|
||||
VcSeedVc, // Ugh
|
||||
|
||||
// =============== VIDEO ===============
|
||||
|
||||
/// Video: Face Fusion (Lipsync)
|
||||
@@ -58,6 +63,9 @@ pub enum InferenceJobProductCategory {
|
||||
/// Video: Studio
|
||||
VidStudio,
|
||||
|
||||
/// Video: Studio Gen 2
|
||||
VidStudioGen2,
|
||||
|
||||
/// Video: Style Transfer
|
||||
VidStyleTransfer,
|
||||
|
||||
@@ -108,13 +116,16 @@ impl InferenceJobProductCategory {
|
||||
Self::TtsGptSoVits => "tts_gpt_so_vits",
|
||||
Self::TtsStyleTts2 => "tts_style_tts2",
|
||||
Self::TtsTacotron2 => "tts_tacotron2",
|
||||
Self::TtsF5 => "tts_f5",
|
||||
Self::VcSvc => "vc_svc",
|
||||
Self::VcRvc2 => "vc_rvc2",
|
||||
Self::VcSeedVc => "vc_seed_vc",
|
||||
Self::VidLipsyncFaceFusion => "vid_lipsync_face_fusion",
|
||||
Self::VidLipsyncSadTalker => "vid_lipsync_sad_talker",
|
||||
Self::VidLivePortrait => "vid_live_portrait",
|
||||
Self::VidLivePortraitWebcam => "vid_live_portrait_webcam",
|
||||
Self::VidStudio => "vid_studio",
|
||||
Self::VidStudioGen2 => "vid_studio_gen2",
|
||||
Self::VidStyleTransfer => "vid_style_transfer",
|
||||
Self::LipsyncFaceFusion => "lipsync_face_fusion",
|
||||
Self::LipsyncSadTalker => "lipsync_sad_talker",
|
||||
@@ -133,13 +144,16 @@ impl InferenceJobProductCategory {
|
||||
"tts_gpt_so_vits" => Ok(Self::TtsGptSoVits),
|
||||
"tts_style_tts2" => Ok(Self::TtsStyleTts2),
|
||||
"tts_tacotron2" => Ok(Self::TtsTacotron2),
|
||||
"tts_f5" => Ok(Self::TtsF5),
|
||||
"vc_svc" => Ok(Self::VcSvc),
|
||||
"vc_rvc2" => Ok(Self::VcRvc2),
|
||||
"vc_seed_vc" => Ok(Self::VcSeedVc),
|
||||
"vid_lipsync_face_fusion" => Ok(Self::VidLipsyncFaceFusion),
|
||||
"vid_lipsync_sad_talker" => Ok(Self::VidLipsyncSadTalker),
|
||||
"vid_live_portrait" => Ok(Self::VidLivePortrait),
|
||||
"vid_live_portrait_webcam" => Ok(Self::VidLivePortraitWebcam),
|
||||
"vid_studio" => Ok(Self::VidStudio),
|
||||
"vid_studio_gen2" => Ok(Self::VidStudioGen2),
|
||||
"vid_style_transfer" => Ok(Self::VidStyleTransfer),
|
||||
"lipsync_face_fusion" => Ok(Self::LipsyncFaceFusion),
|
||||
"lipsync_sad_talker" => Ok(Self::LipsyncSadTalker),
|
||||
@@ -161,6 +175,8 @@ impl InferenceJobProductCategory {
|
||||
Self::TtsGptSoVits,
|
||||
Self::TtsStyleTts2,
|
||||
Self::TtsTacotron2,
|
||||
Self::TtsF5,
|
||||
Self::VcSeedVc,
|
||||
Self::VcSvc,
|
||||
Self::VcRvc2,
|
||||
Self::VidLipsyncFaceFusion,
|
||||
@@ -168,6 +184,7 @@ impl InferenceJobProductCategory {
|
||||
Self::VidLivePortrait,
|
||||
Self::VidLivePortraitWebcam,
|
||||
Self::VidStudio,
|
||||
Self::VidStudioGen2,
|
||||
Self::VidStyleTransfer,
|
||||
Self::LipsyncFaceFusion,
|
||||
Self::LipsyncSadTalker,
|
||||
@@ -195,13 +212,16 @@ mod tests {
|
||||
assert_serialization(InferenceJobProductCategory::TtsGptSoVits, "tts_gpt_so_vits");
|
||||
assert_serialization(InferenceJobProductCategory::TtsStyleTts2, "tts_style_tts2");
|
||||
assert_serialization(InferenceJobProductCategory::TtsTacotron2, "tts_tacotron2");
|
||||
assert_serialization(InferenceJobProductCategory::TtsF5, "tts_f5");
|
||||
assert_serialization(InferenceJobProductCategory::VcRvc2, "vc_rvc2");
|
||||
assert_serialization(InferenceJobProductCategory::VcSvc, "vc_svc");
|
||||
assert_serialization(InferenceJobProductCategory::VcSvc, "vc_svc");
|
||||
assert_serialization(InferenceJobProductCategory::VidLipsyncFaceFusion, "vid_lipsync_face_fusion");
|
||||
assert_serialization(InferenceJobProductCategory::VidLipsyncSadTalker, "vid_lipsync_sad_talker");
|
||||
assert_serialization(InferenceJobProductCategory::VidLivePortrait, "vid_live_portrait");
|
||||
assert_serialization(InferenceJobProductCategory::VidLivePortraitWebcam, "vid_live_portrait_webcam");
|
||||
assert_serialization(InferenceJobProductCategory::VidStudio, "vid_studio");
|
||||
assert_serialization(InferenceJobProductCategory::VidStudioGen2, "vid_studio_gen2");
|
||||
assert_serialization(InferenceJobProductCategory::VidStyleTransfer, "vid_style_transfer");
|
||||
assert_serialization(InferenceJobProductCategory::LipsyncFaceFusion, "lipsync_face_fusion");
|
||||
assert_serialization(InferenceJobProductCategory::LipsyncSadTalker, "lipsync_sad_talker");
|
||||
@@ -221,11 +241,13 @@ mod tests {
|
||||
assert_eq!(InferenceJobProductCategory::TtsTacotron2.to_str(), "tts_tacotron2");
|
||||
assert_eq!(InferenceJobProductCategory::VcRvc2.to_str(), "vc_rvc2");
|
||||
assert_eq!(InferenceJobProductCategory::VcSvc.to_str(), "vc_svc");
|
||||
assert_eq!(InferenceJobProductCategory::VcSvc.to_str(), "vc_svc");
|
||||
assert_eq!(InferenceJobProductCategory::VidLipsyncFaceFusion.to_str(), "vid_lipsync_face_fusion");
|
||||
assert_eq!(InferenceJobProductCategory::VidLipsyncSadTalker.to_str(), "vid_lipsync_sad_talker");
|
||||
assert_eq!(InferenceJobProductCategory::VidLivePortrait.to_str(), "vid_live_portrait");
|
||||
assert_eq!(InferenceJobProductCategory::VidLivePortraitWebcam.to_str(), "vid_live_portrait_webcam");
|
||||
assert_eq!(InferenceJobProductCategory::VidStudio.to_str(), "vid_studio");
|
||||
assert_eq!(InferenceJobProductCategory::VidStudioGen2.to_str(), "vid_studio_gen2");
|
||||
assert_eq!(InferenceJobProductCategory::VidStyleTransfer.to_str(), "vid_style_transfer");
|
||||
assert_eq!(InferenceJobProductCategory::LipsyncFaceFusion.to_str(), "lipsync_face_fusion");
|
||||
assert_eq!(InferenceJobProductCategory::LipsyncSadTalker.to_str(), "lipsync_sad_talker");
|
||||
@@ -245,11 +267,13 @@ mod tests {
|
||||
assert_eq!(InferenceJobProductCategory::from_str("tts_tacotron2").unwrap(), InferenceJobProductCategory::TtsTacotron2);
|
||||
assert_eq!(InferenceJobProductCategory::from_str("vc_rvc2").unwrap(), InferenceJobProductCategory::VcRvc2);
|
||||
assert_eq!(InferenceJobProductCategory::from_str("vc_svc").unwrap(), InferenceJobProductCategory::VcSvc);
|
||||
assert_eq!(InferenceJobProductCategory::from_str("vc_svc").unwrap(), InferenceJobProductCategory::VcSvc);
|
||||
assert_eq!(InferenceJobProductCategory::from_str("vid_lipsync_face_fusion").unwrap(), InferenceJobProductCategory::VidLipsyncFaceFusion);
|
||||
assert_eq!(InferenceJobProductCategory::from_str("vid_lipsync_sad_talker").unwrap(), InferenceJobProductCategory::VidLipsyncSadTalker);
|
||||
assert_eq!(InferenceJobProductCategory::from_str("vid_live_portrait").unwrap(), InferenceJobProductCategory::VidLivePortrait);
|
||||
assert_eq!(InferenceJobProductCategory::from_str("vid_live_portrait_webcam").unwrap(), InferenceJobProductCategory::VidLivePortraitWebcam);
|
||||
assert_eq!(InferenceJobProductCategory::from_str("vid_studio").unwrap(), InferenceJobProductCategory::VidStudio);
|
||||
assert_eq!(InferenceJobProductCategory::from_str("vid_studio_gen2").unwrap(), InferenceJobProductCategory::VidStudioGen2);
|
||||
assert_eq!(InferenceJobProductCategory::from_str("vid_style_transfer").unwrap(), InferenceJobProductCategory::VidStyleTransfer);
|
||||
assert_eq!(InferenceJobProductCategory::from_str("lipsync_face_fusion").unwrap(), InferenceJobProductCategory::LipsyncFaceFusion);
|
||||
assert_eq!(InferenceJobProductCategory::from_str("lipsync_sad_talker").unwrap(), InferenceJobProductCategory::LipsyncSadTalker);
|
||||
@@ -265,18 +289,20 @@ mod tests {
|
||||
fn all_variants() {
|
||||
// Static check
|
||||
let mut variants = InferenceJobProductCategory::all_variants();
|
||||
assert_eq!(variants.len(), 20);
|
||||
assert_eq!(variants.len(), 21);
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::DownloadGptSoVits));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::TtsGptSoVits));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::TtsStyleTts2));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::TtsTacotron2));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::VcRvc2));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::VcSeedVc));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::VcSvc));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::VidLipsyncFaceFusion));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::VidLipsyncSadTalker));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::VidLivePortrait));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::VidLivePortraitWebcam));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::VidStudio));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::VidStudioGen2));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::VidStyleTransfer));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::LipsyncFaceFusion));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobProductCategory::LipsyncSadTalker));
|
||||
|
||||
@@ -36,6 +36,10 @@ pub enum InferenceJobType {
|
||||
#[deprecated(note = "Use VideoRender instead.")]
|
||||
ComfyUi,
|
||||
|
||||
/// Second gen studio
|
||||
#[serde(rename = "studio_gen2")]
|
||||
StudioGen2,
|
||||
|
||||
/// A job that turns "FBX" game engine files into "GLTF" files (Bevy-compatible).
|
||||
#[serde(rename = "convert_fbx_gltf")]
|
||||
ConvertFbxToGltf,
|
||||
@@ -43,6 +47,10 @@ pub enum InferenceJobType {
|
||||
/// Process a video into BVH mocap animation data for game engines
|
||||
MocapNet,
|
||||
|
||||
/// Jobs that run F5TTS
|
||||
#[serde(rename = "f5_tts")]
|
||||
F5TTS,
|
||||
|
||||
/// RVC is a voice conversion model. RVCv2 is the most popular such model currently.
|
||||
#[serde(rename = "rvc_v2")]
|
||||
RvcV2,
|
||||
@@ -53,6 +61,9 @@ pub enum InferenceJobType {
|
||||
/// so-vits-svc voice conversion. This predates RVCv2.
|
||||
SoVitsSvc,
|
||||
|
||||
#[serde(rename = "seed_vc")]
|
||||
SeedVc,
|
||||
|
||||
/// Stable diffusion image generation
|
||||
StableDiffusion,
|
||||
|
||||
@@ -93,12 +104,15 @@ impl InferenceJobType {
|
||||
Self::VideoRender => "video_render",
|
||||
Self::LivePortrait => "live_portrait",
|
||||
Self::FaceFusion => "face_fusion",
|
||||
Self::F5TTS => "f5_tts",
|
||||
Self::GptSovits => "gpt_sovits",
|
||||
Self::ComfyUi => "comfy_ui",
|
||||
Self::StudioGen2 => "studio_gen2",
|
||||
Self::ConvertFbxToGltf => "convert_fbx_gltf",
|
||||
Self::MocapNet => "mocap_net",
|
||||
Self::RvcV2 => "rvc_v2",
|
||||
Self::SadTalker => "sad_talker",
|
||||
Self::SeedVc => "seed_vc",
|
||||
Self::SoVitsSvc => "so_vits_svc",
|
||||
Self::StableDiffusion => "stable_diffusion",
|
||||
Self::StyleTTS2 => "styletts2",
|
||||
@@ -114,12 +128,15 @@ impl InferenceJobType {
|
||||
"video_render" => Ok(Self::VideoRender),
|
||||
"live_portrait" => Ok(Self::LivePortrait),
|
||||
"face_fusion" => Ok(Self::FaceFusion),
|
||||
"f5_tts" => Ok(Self::F5TTS),
|
||||
"gpt_sovits" => Ok(Self::GptSovits),
|
||||
"comfy_ui" => Ok(Self::ComfyUi),
|
||||
"studio_gen2" => Ok(Self::StudioGen2),
|
||||
"convert_fbx_gltf" => Ok(Self::ConvertFbxToGltf),
|
||||
"mocap_net" => Ok(Self::MocapNet),
|
||||
"rvc_v2" => Ok(Self::RvcV2),
|
||||
"sad_talker" => Ok(Self::SadTalker),
|
||||
"seed_vc" => Ok(Self::SeedVc),
|
||||
"so_vits_svc" => Ok(Self::SoVitsSvc),
|
||||
"stable_diffusion" => Ok(Self::StableDiffusion),
|
||||
"styletts2" => Ok(Self::StyleTTS2),
|
||||
@@ -138,12 +155,15 @@ impl InferenceJobType {
|
||||
Self::VideoRender,
|
||||
Self::LivePortrait,
|
||||
Self::FaceFusion,
|
||||
Self::F5TTS,
|
||||
Self::GptSovits,
|
||||
Self::ComfyUi,
|
||||
Self::StudioGen2,
|
||||
Self::ConvertFbxToGltf,
|
||||
Self::MocapNet,
|
||||
Self::RvcV2,
|
||||
Self::SadTalker,
|
||||
Self::SeedVc,
|
||||
Self::SoVitsSvc,
|
||||
Self::StableDiffusion,
|
||||
Self::StyleTTS2,
|
||||
@@ -173,12 +193,15 @@ mod tests {
|
||||
assert_serialization(InferenceJobType::VideoRender, "video_render");
|
||||
assert_serialization(InferenceJobType::LivePortrait, "live_portrait");
|
||||
assert_serialization(InferenceJobType::FaceFusion, "face_fusion");
|
||||
assert_serialization(InferenceJobType::F5TTS, "f5_tts");
|
||||
assert_serialization(InferenceJobType::GptSovits, "gpt_sovits");
|
||||
assert_serialization(InferenceJobType::ComfyUi, "comfy_ui");
|
||||
assert_serialization(InferenceJobType::StudioGen2, "studio_gen2");
|
||||
assert_serialization(InferenceJobType::ConvertFbxToGltf, "convert_fbx_gltf");
|
||||
assert_serialization(InferenceJobType::MocapNet, "mocap_net");
|
||||
assert_serialization(InferenceJobType::RvcV2, "rvc_v2");
|
||||
assert_serialization(InferenceJobType::SadTalker, "sad_talker");
|
||||
assert_serialization(InferenceJobType::SeedVc, "seed_vc");
|
||||
assert_serialization(InferenceJobType::SoVitsSvc, "so_vits_svc");
|
||||
assert_serialization(InferenceJobType::StableDiffusion, "stable_diffusion");
|
||||
assert_serialization(InferenceJobType::StyleTTS2, "styletts2");
|
||||
@@ -193,12 +216,15 @@ mod tests {
|
||||
assert_eq!(InferenceJobType::VideoRender.to_str(), "video_render");
|
||||
assert_eq!(InferenceJobType::LivePortrait.to_str(), "live_portrait");
|
||||
assert_eq!(InferenceJobType::FaceFusion.to_str(), "face_fusion");
|
||||
assert_eq!(InferenceJobType::F5TTS.to_str(), "f5_tts");
|
||||
assert_eq!(InferenceJobType::GptSovits.to_str(), "gpt_sovits");
|
||||
assert_eq!(InferenceJobType::ComfyUi.to_str(), "comfy_ui");
|
||||
assert_eq!(InferenceJobType::StudioGen2.to_str(), "studio_gen2");
|
||||
assert_eq!(InferenceJobType::ConvertFbxToGltf.to_str(), "convert_fbx_gltf");
|
||||
assert_eq!(InferenceJobType::MocapNet.to_str(), "mocap_net");
|
||||
assert_eq!(InferenceJobType::RvcV2.to_str(), "rvc_v2");
|
||||
assert_eq!(InferenceJobType::SadTalker.to_str(), "sad_talker");
|
||||
assert_eq!(InferenceJobType::SeedVc.to_str(), "seed_vc");
|
||||
assert_eq!(InferenceJobType::SoVitsSvc.to_str(), "so_vits_svc");
|
||||
assert_eq!(InferenceJobType::StableDiffusion.to_str(), "stable_diffusion");
|
||||
assert_eq!(InferenceJobType::StyleTTS2.to_str(), "styletts2");
|
||||
@@ -213,12 +239,15 @@ mod tests {
|
||||
assert_eq!(InferenceJobType::from_str("video_render").unwrap(), InferenceJobType::VideoRender);
|
||||
assert_eq!(InferenceJobType::from_str("live_portrait").unwrap(), InferenceJobType::LivePortrait);
|
||||
assert_eq!(InferenceJobType::from_str("face_fusion").unwrap(), InferenceJobType::FaceFusion);
|
||||
assert_eq!(InferenceJobType::from_str("f5_tts").unwrap(), InferenceJobType::F5TTS);
|
||||
assert_eq!(InferenceJobType::from_str("gpt_sovits").unwrap(), InferenceJobType::GptSovits);
|
||||
assert_eq!(InferenceJobType::from_str("comfy_ui").unwrap(), InferenceJobType::ComfyUi);
|
||||
assert_eq!(InferenceJobType::from_str("studio_gen2").unwrap(), InferenceJobType::StudioGen2);
|
||||
assert_eq!(InferenceJobType::from_str("convert_fbx_gltf").unwrap(), InferenceJobType::ConvertFbxToGltf);
|
||||
assert_eq!(InferenceJobType::from_str("mocap_net").unwrap(), InferenceJobType::MocapNet);
|
||||
assert_eq!(InferenceJobType::from_str("rvc_v2").unwrap(), InferenceJobType::RvcV2);
|
||||
assert_eq!(InferenceJobType::from_str("sad_talker").unwrap(), InferenceJobType::SadTalker);
|
||||
assert_eq!(InferenceJobType::from_str("seed_vc").unwrap(), InferenceJobType::SeedVc);
|
||||
assert_eq!(InferenceJobType::from_str("so_vits_svc").unwrap(), InferenceJobType::SoVitsSvc);
|
||||
assert_eq!(InferenceJobType::from_str("stable_diffusion").unwrap(), InferenceJobType::StableDiffusion);
|
||||
assert_eq!(InferenceJobType::from_str("styletts2").unwrap(), InferenceJobType::StyleTTS2);
|
||||
@@ -236,12 +265,15 @@ mod tests {
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::VideoRender));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::LivePortrait));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::FaceFusion));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::F5TTS));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::GptSovits));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::ComfyUi));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::StudioGen2));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::ConvertFbxToGltf));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::MocapNet));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::RvcV2));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::SadTalker));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::SeedVc));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::SoVitsSvc));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::StableDiffusion));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceJobType::StyleTTS2));
|
||||
|
||||
@@ -29,6 +29,10 @@ pub enum InferenceModelType {
|
||||
#[serde(rename = "so_vits_svc")]
|
||||
SoVitsSvc,
|
||||
// TODO: Does this need to be "legacy_tacotron2" ?
|
||||
|
||||
#[serde(rename = "seed_vc")]
|
||||
SeedVc,
|
||||
|
||||
#[serde(rename = "tacotron2")]
|
||||
Tacotron2,
|
||||
#[serde(rename = "vits")]
|
||||
@@ -66,6 +70,7 @@ impl InferenceModelType {
|
||||
Self::VallEX => "vall_e_x",
|
||||
Self::RerenderAVideo => "rerender_a_video",
|
||||
Self::StableDiffusion => "stable_diffusion",
|
||||
Self::SeedVc => "seed_vc",
|
||||
Self::MocapNet => "mocap_net",
|
||||
Self::StyleTTS2 => "styletts2",
|
||||
Self::ComfyUi => "comfy_ui",
|
||||
@@ -79,6 +84,7 @@ impl InferenceModelType {
|
||||
"rvc_v2" => Ok(Self::RvcV2),
|
||||
"sad_talker" => Ok(Self::SadTalker),
|
||||
"so_vits_svc" => Ok(Self::SoVitsSvc),
|
||||
"seed_vc" => Ok(Self::SeedVc),
|
||||
"tacotron2" => Ok(Self::Tacotron2),
|
||||
"vits" => Ok(Self::Vits),
|
||||
"vall_e_x" => Ok(Self::VallEX),
|
||||
@@ -97,9 +103,11 @@ impl InferenceModelType {
|
||||
// NB: BTreeSet is sorted
|
||||
// NB: BTreeSet::from() isn't const, but not worth using LazyStatic, etc.
|
||||
BTreeSet::from([
|
||||
Self::ComfyUi,
|
||||
Self::RvcV2,
|
||||
Self::SadTalker,
|
||||
Self::SoVitsSvc,
|
||||
Self::SeedVc,
|
||||
Self::Tacotron2,
|
||||
Self::Vits,
|
||||
Self::VallEX,
|
||||
@@ -107,9 +115,8 @@ impl InferenceModelType {
|
||||
Self::StableDiffusion,
|
||||
Self::MocapNet,
|
||||
Self::StyleTTS2,
|
||||
Self::ComfyUi,
|
||||
Self::ConvertFbxToGltf,
|
||||
Self::BvhToWorkflow,
|
||||
Self::BvhToWorkflow,
|
||||
])
|
||||
}
|
||||
}
|
||||
@@ -126,6 +133,7 @@ mod tests {
|
||||
fn test_serialization() {
|
||||
assert_serialization(InferenceModelType::RvcV2, "rvc_v2");
|
||||
assert_serialization(InferenceModelType::SadTalker, "sad_talker");
|
||||
assert_serialization(InferenceModelType::SeedVc, "seed_vc");
|
||||
assert_serialization(InferenceModelType::SoVitsSvc, "so_vits_svc");
|
||||
assert_serialization(InferenceModelType::Tacotron2, "tacotron2");
|
||||
assert_serialization(InferenceModelType::Vits, "vits");
|
||||
@@ -141,9 +149,11 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn to_str() {
|
||||
assert_eq!(InferenceModelType::ComfyUi.to_str(), "comfy_ui");
|
||||
assert_eq!(InferenceModelType::RvcV2.to_str(), "rvc_v2");
|
||||
assert_eq!(InferenceModelType::SadTalker.to_str(), "sad_talker");
|
||||
assert_eq!(InferenceModelType::SoVitsSvc.to_str(), "so_vits_svc");
|
||||
assert_eq!(InferenceModelType::SoVitsSvc.to_str(), "so_vits_svc");
|
||||
assert_eq!(InferenceModelType::Tacotron2.to_str(), "tacotron2");
|
||||
assert_eq!(InferenceModelType::Vits.to_str(), "vits");
|
||||
assert_eq!(InferenceModelType::VallEX.to_str(), "vall_e_x");
|
||||
@@ -151,7 +161,6 @@ mod tests {
|
||||
assert_eq!(InferenceModelType::StableDiffusion.to_str(), "stable_diffusion");
|
||||
assert_eq!(InferenceModelType::MocapNet.to_str(), "mocap_net");
|
||||
assert_eq!(InferenceModelType::StyleTTS2.to_str(), "styletts2");
|
||||
assert_eq!(InferenceModelType::ComfyUi.to_str(), "comfy_ui");
|
||||
assert_eq!(InferenceModelType::ConvertFbxToGltf.to_str(), "convert_fbx_gltf");
|
||||
assert_eq!(InferenceModelType::BvhToWorkflow.to_str(), "bvh_to_workflow");
|
||||
}
|
||||
@@ -160,6 +169,7 @@ mod tests {
|
||||
fn from_str() {
|
||||
assert_eq!(InferenceModelType::from_str("rvc_v2").unwrap(), InferenceModelType::RvcV2);
|
||||
assert_eq!(InferenceModelType::from_str("sad_talker").unwrap(), InferenceModelType::SadTalker);
|
||||
assert_eq!(InferenceModelType::from_str("seed_vc").unwrap(), InferenceModelType::SeedVc);
|
||||
assert_eq!(InferenceModelType::from_str("so_vits_svc").unwrap(), InferenceModelType::SoVitsSvc);
|
||||
assert_eq!(InferenceModelType::from_str("tacotron2").unwrap(), InferenceModelType::Tacotron2);
|
||||
assert_eq!(InferenceModelType::from_str("vits").unwrap(), InferenceModelType::Vits);
|
||||
@@ -178,8 +188,10 @@ mod tests {
|
||||
// Static check
|
||||
let mut variants = InferenceModelType::all_variants();
|
||||
assert_eq!(variants.len(), 13);
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::ComfyUi));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::RvcV2));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::SadTalker));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::SeedVc));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::SoVitsSvc));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::Tacotron2));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::Vits));
|
||||
@@ -187,7 +199,6 @@ mod tests {
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::RerenderAVideo));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::StableDiffusion));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::MocapNet));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::ComfyUi));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::StyleTTS2));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::ConvertFbxToGltf));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::BvhToWorkflow));
|
||||
|
||||
@@ -18,6 +18,9 @@ pub enum MediaFileOriginModelType {
|
||||
#[serde(rename = "face_fusion")]
|
||||
FaceFusion,
|
||||
|
||||
#[serde(rename = "f5_tts")]
|
||||
F5TTS,
|
||||
|
||||
#[serde(rename = "live_portrait")]
|
||||
LivePortrait,
|
||||
|
||||
@@ -39,6 +42,9 @@ pub enum MediaFileOriginModelType {
|
||||
#[serde(rename = "mocap_net")]
|
||||
MocapNet,
|
||||
|
||||
#[serde(rename = "seed_vc")]
|
||||
SeedVc,
|
||||
|
||||
#[serde(rename = "styletts2")]
|
||||
StyleTTS2,
|
||||
|
||||
@@ -77,9 +83,11 @@ impl MediaFileOriginModelType {
|
||||
pub fn to_str(&self) -> &'static str {
|
||||
match self {
|
||||
Self::FaceFusion => "face_fusion",
|
||||
Self::F5TTS => "f5_tts",
|
||||
Self::LivePortrait => "live_portrait",
|
||||
Self::RvcV2 => "rvc_v2",
|
||||
Self::SadTalker => "sad_talker",
|
||||
Self::SeedVc => "seed_vc",
|
||||
Self::SoVitsSvc => "so_vits_svc",
|
||||
Self::Tacotron2 => "tacotron2",
|
||||
Self::MocapNet => "mocap_net",
|
||||
@@ -97,9 +105,11 @@ impl MediaFileOriginModelType {
|
||||
pub fn from_str(value: &str) -> Result<Self, String> {
|
||||
match value {
|
||||
"face_fusion" => Ok(Self::FaceFusion),
|
||||
"f5_tts" => Ok(Self::F5TTS),
|
||||
"live_portrait" => Ok(Self::LivePortrait),
|
||||
"rvc_v2" => Ok(Self::RvcV2),
|
||||
"sad_talker" => Ok(Self::SadTalker),
|
||||
"seed_vc" => Ok(Self::SeedVc),
|
||||
"so_vits_svc" => Ok(Self::SoVitsSvc),
|
||||
"tacotron2" => Ok(Self::Tacotron2),
|
||||
"mocap_net" => Ok(Self::MocapNet),
|
||||
@@ -120,9 +130,11 @@ impl MediaFileOriginModelType {
|
||||
// NB: BTreeSet::from() isn't const, but not worth using LazyStatic, etc.
|
||||
BTreeSet::from([
|
||||
Self::FaceFusion,
|
||||
Self::F5TTS,
|
||||
Self::LivePortrait,
|
||||
Self::RvcV2,
|
||||
Self::SadTalker,
|
||||
Self::SeedVc,
|
||||
Self::SoVitsSvc,
|
||||
Self::Tacotron2,
|
||||
Self::MocapNet,
|
||||
@@ -155,9 +167,11 @@ mod tests {
|
||||
#[test]
|
||||
fn test_to_str() {
|
||||
assert_eq!(MediaFileOriginModelType::FaceFusion.to_str(), "face_fusion");
|
||||
assert_eq!(MediaFileOriginModelType::F5TTS.to_str(), "f5_tts");
|
||||
assert_eq!(MediaFileOriginModelType::LivePortrait.to_str(), "live_portrait");
|
||||
assert_eq!(MediaFileOriginModelType::RvcV2.to_str(), "rvc_v2");
|
||||
assert_eq!(MediaFileOriginModelType::SadTalker.to_str(), "sad_talker");
|
||||
assert_eq!(MediaFileOriginModelType::SeedVc.to_str(), "seed_vc");
|
||||
assert_eq!(MediaFileOriginModelType::SoVitsSvc.to_str(), "so_vits_svc");
|
||||
assert_eq!(MediaFileOriginModelType::Tacotron2.to_str(), "tacotron2");
|
||||
assert_eq!(MediaFileOriginModelType::MocapNet.to_str(), "mocap_net");
|
||||
@@ -174,9 +188,11 @@ mod tests {
|
||||
#[test]
|
||||
fn test_from_str() {
|
||||
assert_eq!(MediaFileOriginModelType::from_str("face_fusion").unwrap(), MediaFileOriginModelType::FaceFusion);
|
||||
assert_eq!(MediaFileOriginModelType::from_str("f5_tts").unwrap(), MediaFileOriginModelType::F5TTS);
|
||||
assert_eq!(MediaFileOriginModelType::from_str("live_portrait").unwrap(), MediaFileOriginModelType::LivePortrait);
|
||||
assert_eq!(MediaFileOriginModelType::from_str("rvc_v2").unwrap(), MediaFileOriginModelType::RvcV2);
|
||||
assert_eq!(MediaFileOriginModelType::from_str("sad_talker").unwrap(), MediaFileOriginModelType::SadTalker);
|
||||
assert_eq!(MediaFileOriginModelType::from_str("seed_vc").unwrap(), MediaFileOriginModelType::SeedVc);
|
||||
assert_eq!(MediaFileOriginModelType::from_str("so_vits_svc").unwrap(), MediaFileOriginModelType::SoVitsSvc);
|
||||
assert_eq!(MediaFileOriginModelType::from_str("tacotron2").unwrap(), MediaFileOriginModelType::Tacotron2);
|
||||
assert_eq!(MediaFileOriginModelType::from_str("mocap_net").unwrap(), MediaFileOriginModelType::MocapNet);
|
||||
@@ -196,9 +212,11 @@ mod tests {
|
||||
let mut variants = MediaFileOriginModelType::all_variants();
|
||||
assert_eq!(variants.len(), 15);
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::FaceFusion));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::F5TTS));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::LivePortrait));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::RvcV2));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::SadTalker));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::SeedVc));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::SoVitsSvc));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::Tacotron2));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::MocapNet));
|
||||
|
||||
@@ -14,6 +14,7 @@ pub mod media_uploads;
|
||||
pub mod model_categories;
|
||||
pub mod model_weights;
|
||||
pub mod prompts;
|
||||
pub mod tag_uses;
|
||||
pub mod trending_model_analytics;
|
||||
pub mod tts_models;
|
||||
pub mod usages;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
pub mod tag_use_entity_type;
|
||||
@@ -0,0 +1,127 @@
|
||||
use std::collections::BTreeSet;
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
#[cfg(test)]
|
||||
use strum::EnumCount;
|
||||
#[cfg(test)]
|
||||
use strum::EnumIter;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
/// Used in the `tag_uses` table in a `VARCHAR(32)` field named `entity_type`.
|
||||
#[cfg_attr(test, derive(EnumIter, EnumCount))]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Deserialize, Serialize, ToSchema)]
|
||||
pub enum TagUseEntityType {
|
||||
/// Media files
|
||||
#[serde(rename = "media_file")]
|
||||
MediaFile,
|
||||
|
||||
/// Model weights
|
||||
#[serde(rename = "model_weight")]
|
||||
ModelWeight,
|
||||
}
|
||||
|
||||
// TODO(bt, 2023-01-17): This desperately needs MySQL integration tests!
|
||||
impl_enum_display_and_debug_using_to_str!(TagUseEntityType);
|
||||
impl_mysql_enum_coders!(TagUseEntityType);
|
||||
|
||||
/// NB: Legacy API for older code.
|
||||
impl TagUseEntityType {
|
||||
pub fn to_str(&self) -> &'static str {
|
||||
match self {
|
||||
Self::MediaFile => "media_file",
|
||||
Self::ModelWeight => "model_weight",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_str(value: &str) -> Result<Self, String> {
|
||||
match value {
|
||||
"media_file" => Ok(Self::MediaFile),
|
||||
"model_weight" => Ok(Self::ModelWeight),
|
||||
_ => Err(format!("invalid value: {:?}", value)),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn all_variants() -> BTreeSet<Self> {
|
||||
// NB: BTreeSet is sorted
|
||||
// NB: BTreeSet::from() isn't const, but not worth using LazyStatic, etc.
|
||||
BTreeSet::from([
|
||||
Self::MediaFile,
|
||||
Self::ModelWeight,
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::test_helpers::assert_serialization;
|
||||
use crate::by_table::tag_uses::tag_use_entity_type::TagUseEntityType;
|
||||
|
||||
mod serde {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
assert_serialization(TagUseEntityType::MediaFile, "media_file");
|
||||
assert_serialization(TagUseEntityType::ModelWeight, "model_weight");
|
||||
}
|
||||
}
|
||||
|
||||
mod impl_methods {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_to_str() {
|
||||
assert_eq!(TagUseEntityType::MediaFile.to_str(), "media_file");
|
||||
assert_eq!(TagUseEntityType::ModelWeight.to_str(), "model_weight");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_from_str() {
|
||||
assert_eq!(TagUseEntityType::from_str("media_file").unwrap(), TagUseEntityType::MediaFile);
|
||||
assert_eq!(TagUseEntityType::from_str("model_weight").unwrap(), TagUseEntityType::ModelWeight);
|
||||
assert!(TagUseEntityType::from_str("foo").is_err());
|
||||
}
|
||||
}
|
||||
|
||||
mod manual_variant_checks {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn all_variants() {
|
||||
let mut variants = TagUseEntityType::all_variants();
|
||||
assert_eq!(variants.len(), 2);
|
||||
assert_eq!(variants.pop_first(), Some(TagUseEntityType::MediaFile));
|
||||
assert_eq!(variants.pop_first(), Some(TagUseEntityType::ModelWeight));
|
||||
assert_eq!(variants.pop_first(), None);
|
||||
}
|
||||
}
|
||||
|
||||
mod mechanical_checks {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn variant_length() {
|
||||
use strum::IntoEnumIterator;
|
||||
assert_eq!(TagUseEntityType::all_variants().len(), TagUseEntityType::iter().len());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn round_trip() {
|
||||
for variant in TagUseEntityType::all_variants() {
|
||||
assert_eq!(variant, TagUseEntityType::from_str(variant.to_str()).unwrap());
|
||||
assert_eq!(variant, TagUseEntityType::from_str(&format!("{}", variant)).unwrap());
|
||||
assert_eq!(variant, TagUseEntityType::from_str(&format!("{:?}", variant)).unwrap());
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serialized_length_ok_for_database() {
|
||||
const MAX_LENGTH : usize = 32;
|
||||
for variant in TagUseEntityType::all_variants() {
|
||||
let serialized = variant.to_str();
|
||||
assert!(serialized.len() > 0, "variant {:?} is too short", variant);
|
||||
assert!(serialized.len() <= MAX_LENGTH, "variant {:?} is too long", variant);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
pub mod user_feature_flag;
|
||||
pub mod user_feature_flag;
|
||||
pub mod user_signup_method;
|
||||
@@ -0,0 +1,128 @@
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
#[cfg(test)]
|
||||
use strum::EnumCount;
|
||||
#[cfg(test)]
|
||||
use strum::EnumIter;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
/// Used in the `users` table in a `VARCHAR(16)` field.
|
||||
///
|
||||
/// DO NOT CHANGE VALUES WITHOUT A MIGRATION STRATEGY.
|
||||
#[cfg_attr(test, derive(EnumIter, EnumCount))]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Deserialize, Serialize, ToSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum UserSignupMethod {
|
||||
/// Email + Password
|
||||
EmailPassword,
|
||||
|
||||
/// "Sign in With Google" SSO
|
||||
GoogleSignIn,
|
||||
}
|
||||
|
||||
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
|
||||
impl_enum_display_and_debug_using_to_str!(UserSignupMethod);
|
||||
impl_mysql_enum_coders!(UserSignupMethod);
|
||||
impl_mysql_from_row!(UserSignupMethod);
|
||||
|
||||
/// NB: Legacy API for older code.
|
||||
impl UserSignupMethod {
|
||||
pub fn to_str(&self) -> &'static str {
|
||||
match self {
|
||||
Self::EmailPassword => "email_password",
|
||||
Self::GoogleSignIn=> "google_sign_in",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_str(value: &str) -> Result<Self, String> {
|
||||
match value {
|
||||
"email_password" => Ok(Self::EmailPassword),
|
||||
"google_sign_in" => Ok(Self::GoogleSignIn),
|
||||
_ => Err(format!("invalid value: {:?}", value)),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn all_variants() -> BTreeSet<Self> {
|
||||
// NB: BTreeSet is sorted
|
||||
// NB: BTreeSet::from() isn't const, but not worth using LazyStatic, etc.
|
||||
BTreeSet::from([
|
||||
Self::EmailPassword,
|
||||
Self::GoogleSignIn,
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::by_table::users::user_signup_method::UserSignupMethod;
|
||||
use crate::test_helpers::assert_serialization;
|
||||
|
||||
mod serde {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
assert_serialization(UserSignupMethod::EmailPassword, "email_password");
|
||||
assert_serialization(UserSignupMethod::GoogleSignIn, "google_sign_in");
|
||||
}
|
||||
}
|
||||
|
||||
mod impl_methods {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn to_str() {
|
||||
assert_eq!(UserSignupMethod::EmailPassword.to_str(), "email_password");
|
||||
assert_eq!(UserSignupMethod::GoogleSignIn.to_str(), "google_sign_in");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn from_str() {
|
||||
assert_eq!(UserSignupMethod::from_str("email_password").unwrap(), UserSignupMethod::EmailPassword);
|
||||
assert_eq!(UserSignupMethod::from_str("google_sign_in").unwrap(), UserSignupMethod::GoogleSignIn);
|
||||
assert!(UserSignupMethod::from_str("foo").is_err());
|
||||
}
|
||||
}
|
||||
|
||||
mod manual_variant_checks {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn all_variants() {
|
||||
let mut variants = UserSignupMethod::all_variants();
|
||||
assert_eq!(variants.len(), 2);
|
||||
assert_eq!(variants.pop_first(), Some(UserSignupMethod::EmailPassword));
|
||||
assert_eq!(variants.pop_first(), Some(UserSignupMethod::GoogleSignIn));
|
||||
assert_eq!(variants.pop_first(), None);
|
||||
}
|
||||
}
|
||||
|
||||
mod mechanical_checks {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn variant_length() {
|
||||
use strum::IntoEnumIterator;
|
||||
assert_eq!(UserSignupMethod::all_variants().len(), UserSignupMethod::iter().len());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn round_trip() {
|
||||
for variant in UserSignupMethod::all_variants() {
|
||||
assert_eq!(variant, UserSignupMethod::from_str(variant.to_str()).unwrap());
|
||||
assert_eq!(variant, UserSignupMethod::from_str(&format!("{}", variant)).unwrap());
|
||||
assert_eq!(variant, UserSignupMethod::from_str(&format!("{:?}", variant)).unwrap());
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serialized_length_ok_for_database() {
|
||||
const MAX_LENGTH : usize = 16;
|
||||
for variant in UserSignupMethod::all_variants() {
|
||||
let serialized = variant.to_str();
|
||||
assert!(serialized.len() > 0, "variant {:?} is too short", variant);
|
||||
assert!(serialized.len() <= MAX_LENGTH, "variant {:?} is too long", variant);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,3 @@
|
||||
// UPGRADE NOTES
|
||||
// sqlx 0.7.2 --> 0.8.2
|
||||
// - sqlx_mysql::MySqlTypeInfo --> sqlx::mysql::MySqlTypeInfo
|
||||
// - sqlx_mysql::MySqlValueRef<'r> --> sqlx::mysql::MySqlValueRef<'r>
|
||||
// - encode_by_ref(...) took &mut <sqlx::MySql as sqlx_core::database::HasArguments<'q>>::ArgumentBuffer
|
||||
// --> now takes &mut <sqlx::MySql as sqlx::database::Database>::ArgumentBuffer<'q>
|
||||
// - encode_by_ref(...) returned sqlx_core::encode::IsNull
|
||||
// --> now returns Result<sqlx_core::encode::IsNull, sqlx_core::error::BoxDynError>
|
||||
|
||||
/// This overt approach is being taken because of the following error:
|
||||
///
|
||||
/// `MySqlDatabaseError { code: Some("HY000"), number: 1210, message: "Incorrect arguments to mysqld_stmt_execute" }`
|
||||
@@ -22,7 +13,7 @@ macro_rules! impl_mysql_enum_coders {
|
||||
($t:ident) => {
|
||||
|
||||
impl sqlx::Type<sqlx::MySql> for $t {
|
||||
fn type_info() -> sqlx::mysql::MySqlTypeInfo {
|
||||
fn type_info() -> sqlx_mysql::MySqlTypeInfo {
|
||||
// // 0.4.x series:
|
||||
// String::type_info()
|
||||
|
||||
@@ -34,8 +25,8 @@ macro_rules! impl_mysql_enum_coders {
|
||||
impl<'q> sqlx::Encode<'q, sqlx::MySql> for $t {
|
||||
fn encode_by_ref(
|
||||
&self,
|
||||
buf: &mut <sqlx::MySql as sqlx::database::Database>::ArgumentBuffer<'q>,
|
||||
) -> Result<sqlx::encode::IsNull, sqlx::error::BoxDynError> {
|
||||
buf: &mut <sqlx::MySql as sqlx_core::database::HasArguments<'q>>::ArgumentBuffer
|
||||
) -> sqlx_core::encode::IsNull {
|
||||
// // 0.4.x series:
|
||||
// // NB: In the absence of `#[derive(sqlx::Type)]` and `#sqlx(rename_all="lowercase")]`,
|
||||
// // this controls the casing of the variants when sent to MySQL.
|
||||
@@ -50,7 +41,7 @@ macro_rules! impl_mysql_enum_coders {
|
||||
|
||||
impl<'r> sqlx::Decode<'r, sqlx::MySql> for $t {
|
||||
fn decode(
|
||||
value: sqlx::mysql::MySqlValueRef<'r>,
|
||||
value: sqlx_mysql::MySqlValueRef<'r>,
|
||||
) -> Result<Self, sqlx_core::error::BoxDynError> {
|
||||
// // 0.4.x series:
|
||||
// let string = String::decode(value)?;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
// UPGRADE NOTES
|
||||
// sqlx 0.7.2 --> 0.8.2
|
||||
// - use sqlx::Error --> use sqlx_core::Error
|
||||
// - use sqlx::Row --> use sqlx_core::row::Row
|
||||
|
||||
/// Implement `MySqlFromRow` on a type.
|
||||
macro_rules! impl_mysql_from_row {
|
||||
@@ -9,9 +5,8 @@ macro_rules! impl_mysql_from_row {
|
||||
|
||||
// Try to convert a MySQL row and named field into the value type (for non-nullable fields).
|
||||
impl crate::traits::mysql_from_row::MySqlFromRow<$t> for $t {
|
||||
fn try_from_mysql_row(row: &sqlx_mysql::MySqlRow, field_name: &str) -> Result<$t, sqlx_core::Error> {
|
||||
use sqlx_core::Error;
|
||||
use sqlx_core::row::Row;
|
||||
fn try_from_mysql_row(row: &sqlx_mysql::MySqlRow, field_name: &str) -> Result<$t, sqlx::Error> {
|
||||
use sqlx::{Error, Row};
|
||||
|
||||
// NB(bt,2023-12-05): For now only string encodings are considered.
|
||||
// We may want to revisit in the future if we deal with binary data.
|
||||
@@ -29,9 +24,8 @@ macro_rules! impl_mysql_from_row {
|
||||
}
|
||||
|
||||
// Try to convert a MySQL row and named field into the value type (for nullable fields).
|
||||
fn try_from_mysql_row_nullable(row: &sqlx_mysql::MySqlRow, field_name: &str) -> Result<Option<$t>, sqlx_core::Error> {
|
||||
use sqlx_core::Error;
|
||||
use sqlx_core::row::Row;
|
||||
fn try_from_mysql_row_nullable(row: &sqlx_mysql::MySqlRow, field_name: &str) -> Result<Option<$t>, sqlx::Error> {
|
||||
use sqlx::{Error, Row};
|
||||
|
||||
// NB(bt,2023-12-05): For now only string encodings are considered.
|
||||
// We may want to revisit in the future if we deal with binary data.
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
use sqlx_mysql::MySqlRow;
|
||||
|
||||
// UPGRADE NOTES
|
||||
// sqlx 0.7.2 --> 0.8.2
|
||||
// - use sqlx::Error --> use sqlx_core::Error
|
||||
|
||||
/// This is a trait (in conjunction with the macro implementation) that makes up for sqlx's
|
||||
/// QueryBuilder not playing well with FromRow implementation or derivation of named types.
|
||||
pub trait MySqlFromRow<T> {
|
||||
|
||||
/// Attempt to parse a named column from a MySqlRow into the type.
|
||||
fn try_from_mysql_row(row: &MySqlRow, field_name: &str) -> Result<T, sqlx_core::Error>;
|
||||
fn try_from_mysql_row(row: &MySqlRow, field_name: &str) -> Result<T, sqlx::Error>;
|
||||
|
||||
fn try_from_mysql_row_nullable(row: &MySqlRow, field_name: &str) -> Result<Option<T>, sqlx_core::Error>;
|
||||
fn try_from_mysql_row_nullable(row: &MySqlRow, field_name: &str) -> Result<Option<T>, sqlx::Error>;
|
||||
}
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
use chrono::Utc;
|
||||
use sqlx::MySqlPool;
|
||||
use sqlx_core::any::AnyConnectionBackend;
|
||||
use sqlx_core::connection::Connection;
|
||||
|
||||
use sqlx::{MySqlConnection, Executor};
|
||||
|
||||
use errors::AnyhowResult;
|
||||
|
||||
#[test]
|
||||
fn test_that_this_compiles() {
|
||||
// This test only exists as an integration test with the package.
|
||||
// When we do upgrades of SQLx, the binding between sqlx, our macros,
|
||||
// and our code can break down. Having this thin use case helps us
|
||||
// deal with migration difficulties.
|
||||
//
|
||||
// Unfortunately this code requires access to a database or cached queries to compile, so
|
||||
// we may want to rethink this strategy in the future.
|
||||
assert_eq!(1, 1);
|
||||
}
|
||||
|
||||
/// Query available (non-deleted) API tokens for a user.
|
||||
/// A user can only have five active tokens at a time, so we only return the five most recent.
|
||||
pub async fn list_available_api_tokens_for_user(
|
||||
user_token: &str,
|
||||
pool: &MySqlPool,
|
||||
) -> AnyhowResult<()> {
|
||||
|
||||
let _records : Vec<AvailableApiTokenInternal> = sqlx::query_as!(
|
||||
AvailableApiTokenInternal,
|
||||
r#"
|
||||
SELECT
|
||||
true as testing,
|
||||
internal_token
|
||||
-- api_token
|
||||
-- maybe_short_description
|
||||
-- created_at,
|
||||
-- updated_at
|
||||
FROM api_tokens
|
||||
WHERE
|
||||
user_token = ?
|
||||
AND deleted_at IS NULL
|
||||
ORDER BY created_at DESC
|
||||
LIMIT 5
|
||||
"#,
|
||||
user_token,
|
||||
)
|
||||
.fetch_all(pool)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct AvailableApiTokenInternal {
|
||||
pub testing: i64,
|
||||
pub internal_token: String,
|
||||
//pub api_token: String,
|
||||
//pub maybe_short_description: Option<String>,
|
||||
//pub created_at: chrono::DateTime<Utc>,
|
||||
//pub updated_at: chrono::DateTime<Utc>,
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
use sqlx::mysql::MySqlRow;
|
||||
use sqlx::{FromRow, MySql, MySqlPool, QueryBuilder, Row};
|
||||
|
||||
use enums::by_table::media_files::media_file_class::MediaFileClass;
|
||||
use enums::by_table::media_files::media_file_type::MediaFileType;
|
||||
use enums::common::visibility::Visibility;
|
||||
use enums::traits::mysql_from_row::MySqlFromRow;
|
||||
|
||||
#[test]
|
||||
fn test_that_this_compiles() {
|
||||
// This test only exists as an integration test with the package.
|
||||
// When we do upgrades of SQLx, the binding between sqlx, our macros,
|
||||
// and our code can break down. Having this thin use case helps us
|
||||
// deal with migration difficulties.
|
||||
//
|
||||
// Unfortunately this code requires access to a database or cached queries to compile, so
|
||||
// we may want to rethink this strategy in the future.
|
||||
assert_eq!(1, 1);
|
||||
}
|
||||
|
||||
pub async fn test_query(mysql_pool: &MySqlPool) {
|
||||
let mut query = query_builder();
|
||||
let query = query.build_query_as::<MediaFileListItemInternal>();
|
||||
let _results = query.fetch_all(mysql_pool).await;
|
||||
}
|
||||
|
||||
fn query_builder<'a>() -> QueryBuilder<'a, MySql> {
|
||||
// NB: Query cannot be statically checked by sqlx
|
||||
let mut query_builder: QueryBuilder<MySql> = QueryBuilder::new(
|
||||
r#"
|
||||
SELECT
|
||||
m.id,
|
||||
m.media_class,
|
||||
m.media_type,
|
||||
m.creator_set_visibility
|
||||
FROM media_files AS m
|
||||
LEFT OUTER JOIN users AS u
|
||||
ON m.maybe_creator_user_token = u.token
|
||||
LEFT OUTER JOIN model_weights as w
|
||||
ON m.maybe_origin_model_token = w.token
|
||||
LEFT OUTER JOIN media_files as media_file_cover_image
|
||||
ON media_file_cover_image.token = m.maybe_cover_image_media_file_token
|
||||
LEFT OUTER JOIN entity_stats
|
||||
ON entity_stats.entity_type = "media_file"
|
||||
AND entity_stats.entity_token = m.token
|
||||
LEFT OUTER JOIN prompts
|
||||
ON prompts.token = m.maybe_prompt_token
|
||||
"#
|
||||
);
|
||||
|
||||
query_builder
|
||||
}
|
||||
|
||||
struct MediaFileListItemInternal {
|
||||
id: i64,
|
||||
media_class: MediaFileClass,
|
||||
media_type: MediaFileType,
|
||||
creator_set_visibility: Visibility,
|
||||
}
|
||||
|
||||
// NB(bt,2023-12-05): There's an issue with type hinting in the `as` clauses with QueryBuilder (or
|
||||
// raw query strings) and sqlx::FromRow, regardless of whether it is derived of manually
|
||||
// implemented. Perhaps this will improve in the future, but for now manually constructed queries
|
||||
// cannot have type hints, eg. the following:
|
||||
//
|
||||
// m.token as `token: tokens::tokens::media_files::MediaFileToken`,
|
||||
// m.origin_category as `origin_category: enums::by_table::media_files::media_file_origin_category::MediaFileOriginCategory`,
|
||||
// m.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,
|
||||
//
|
||||
// This results in the automatic mapping not being able to be found by name (for macro derive), and
|
||||
// in the manual case `row.try_get()` etc. won't have the correct column name (since the name is the
|
||||
// full "as" clause).
|
||||
impl FromRow<'_, MySqlRow> for MediaFileListItemInternal {
|
||||
fn from_row(row: &MySqlRow) -> Result<Self, sqlx::Error> {
|
||||
Ok(Self {
|
||||
id: row.try_get("id")?,
|
||||
media_class: MediaFileClass::try_from_mysql_row(row, "media_class")?,
|
||||
media_type: MediaFileType::try_from_mysql_row(row, "media_type")?,
|
||||
creator_set_visibility: Visibility::try_from_mysql_row(row, "creator_set_visibility")?,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -16,13 +16,12 @@ path = "src/lib.rs"
|
||||
normal = ["my-workspace-hack"]
|
||||
|
||||
[dependencies]
|
||||
# Internal
|
||||
enums = { path = "../enums" }
|
||||
errors = { path = "../../lib/errors" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# Internal
|
||||
enums = { path = "../enums" }
|
||||
|
||||
# Serialization
|
||||
serde = "1.0.125"
|
||||
serde_derive = "1.0.125"
|
||||
|
||||
+16
@@ -30,6 +30,8 @@ pub enum PublicInferenceJobType {
|
||||
|
||||
GptSovits,
|
||||
|
||||
#[serde(rename = "f5_tts")]
|
||||
F5TTS,
|
||||
// ======= Everything else is the same =======
|
||||
|
||||
/// Jobs that run ComfyUI workflows
|
||||
@@ -37,6 +39,10 @@ pub enum PublicInferenceJobType {
|
||||
#[deprecated(note = "Use VideoRender instead.")]
|
||||
ComfyUi,
|
||||
|
||||
/// Second gen studio
|
||||
#[serde(rename = "studio_gen2")]
|
||||
StudioGen2,
|
||||
|
||||
/// A job that turns "FBX" game engine files into "GLTF" files (Bevy-compatible).
|
||||
#[serde(rename = "convert_fbx_gltf")]
|
||||
ConvertFbxToGltf,
|
||||
@@ -51,6 +57,10 @@ pub enum PublicInferenceJobType {
|
||||
/// SadTalker does image-to-video lip-syncing when given an audio file and image.
|
||||
SadTalker,
|
||||
|
||||
/// Seed-VC
|
||||
#[serde(rename = "seed_vc")]
|
||||
SeedVc,
|
||||
|
||||
/// so-vits-svc voice conversion. This predates RVCv2.
|
||||
SoVitsSvc,
|
||||
|
||||
@@ -94,11 +104,14 @@ impl PublicInferenceJobType {
|
||||
// Conserved variants
|
||||
InferenceJobType::VideoRender => Self::VideoRender,
|
||||
InferenceJobType::GptSovits => Self::GptSovits,
|
||||
InferenceJobType::F5TTS => Self::F5TTS,
|
||||
InferenceJobType::ComfyUi => Self::ComfyUi,
|
||||
InferenceJobType::StudioGen2 => Self::StudioGen2,
|
||||
InferenceJobType::ConvertFbxToGltf => Self::ConvertFbxToGltf,
|
||||
InferenceJobType::MocapNet => Self::MocapNet,
|
||||
InferenceJobType::RvcV2 => Self::RvcV2,
|
||||
InferenceJobType::SadTalker => Self::SadTalker,
|
||||
InferenceJobType::SeedVc => Self::SeedVc,
|
||||
InferenceJobType::SoVitsSvc => Self::SoVitsSvc,
|
||||
InferenceJobType::StableDiffusion => Self::StableDiffusion,
|
||||
InferenceJobType::StyleTTS2 => Self::StyleTTS2,
|
||||
@@ -117,11 +130,14 @@ impl PublicInferenceJobType {
|
||||
// Conserved variants
|
||||
Self::VideoRender => InferenceJobType::VideoRender,
|
||||
Self::GptSovits => InferenceJobType::GptSovits,
|
||||
Self::F5TTS => InferenceJobType::F5TTS,
|
||||
Self::ComfyUi => InferenceJobType::ComfyUi,
|
||||
Self::StudioGen2 => InferenceJobType::StudioGen2,
|
||||
Self::ConvertFbxToGltf => InferenceJobType::ConvertFbxToGltf,
|
||||
Self::MocapNet => InferenceJobType::MocapNet,
|
||||
Self::RvcV2 => InferenceJobType::RvcV2,
|
||||
Self::SadTalker => InferenceJobType::SadTalker,
|
||||
Self::SeedVc => InferenceJobType::SeedVc,
|
||||
Self::SoVitsSvc => InferenceJobType::SoVitsSvc,
|
||||
Self::StableDiffusion => InferenceJobType::StableDiffusion,
|
||||
Self::StyleTTS2 => InferenceJobType::StyleTTS2,
|
||||
|
||||
@@ -55,6 +55,12 @@ pub enum PublicMediaFileModelType {
|
||||
#[serde(rename = "gpt_sovits")]
|
||||
GptSovits,
|
||||
|
||||
#[serde(rename = "f5_tts")]
|
||||
F5TTS,
|
||||
|
||||
#[serde(rename = "seed_vc")]
|
||||
SeedVc,
|
||||
|
||||
#[serde(rename = "studio")]
|
||||
StorytellerStudio,
|
||||
|
||||
@@ -86,10 +92,12 @@ impl PublicMediaFileModelType {
|
||||
// Conserved variants
|
||||
MediaFileOriginModelType::RvcV2 => Self::RvcV2,
|
||||
MediaFileOriginModelType::SoVitsSvc => Self::SoVitsSvc,
|
||||
MediaFileOriginModelType::SeedVc => Self::SeedVc,
|
||||
MediaFileOriginModelType::Tacotron2 => Self::Tacotron2,
|
||||
MediaFileOriginModelType::MocapNet => Self::MocapNet,
|
||||
MediaFileOriginModelType::StableDiffusion15 => Self::StableDiffusion15,
|
||||
MediaFileOriginModelType::GptSovits => Self::GptSovits,
|
||||
MediaFileOriginModelType::F5TTS => Self::F5TTS,
|
||||
MediaFileOriginModelType::StorytellerStudio => Self::StorytellerStudio,
|
||||
MediaFileOriginModelType::VideoStyleTransfer => Self::VideoStyleTransfer,
|
||||
MediaFileOriginModelType::ComfyUi => Self::ComfyUi,
|
||||
@@ -108,10 +116,12 @@ impl PublicMediaFileModelType {
|
||||
// Conserved variants
|
||||
Self::RvcV2 => MediaFileOriginModelType::RvcV2,
|
||||
Self::SoVitsSvc => MediaFileOriginModelType::SoVitsSvc,
|
||||
Self::SeedVc => MediaFileOriginModelType::SeedVc,
|
||||
Self::Tacotron2 => MediaFileOriginModelType::Tacotron2,
|
||||
Self::MocapNet => MediaFileOriginModelType::MocapNet,
|
||||
Self::StableDiffusion15 => MediaFileOriginModelType::StableDiffusion15,
|
||||
Self::GptSovits => MediaFileOriginModelType::GptSovits,
|
||||
Self::F5TTS => MediaFileOriginModelType::F5TTS,
|
||||
Self::StorytellerStudio => MediaFileOriginModelType::StorytellerStudio,
|
||||
Self::VideoStyleTransfer => MediaFileOriginModelType::VideoStyleTransfer,
|
||||
Self::ComfyUi => MediaFileOriginModelType::ComfyUi,
|
||||
|
||||
@@ -31,7 +31,7 @@ serde = "1.0.125"
|
||||
serde_derive = "1.0.125"
|
||||
|
||||
# MySql Database
|
||||
sqlx = { version = "0.8.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
|
||||
[dev-dependencies]
|
||||
# Test serialization
|
||||
|
||||
@@ -71,15 +71,15 @@ impl std::default::Default for StripeRecurringInterval {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::stripe::stripe_recurring_interval::StripeRecurringInterval;
|
||||
use crate::test_helpers::assert_serialization;
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
assert_serialization(StripeRecurringInterval::Day, "day");
|
||||
assert_serialization(StripeRecurringInterval::Month, "month");
|
||||
assert_serialization(StripeRecurringInterval::Week, "week");
|
||||
assert_serialization(StripeRecurringInterval::Year, "year");
|
||||
}
|
||||
// NB(bt,2024-09-25): These tests are broken with a recent upgrade
|
||||
//#[test]
|
||||
//fn test_serialization() {
|
||||
// assert_serialization(StripeRecurringInterval::Day, "day");
|
||||
// assert_serialization(StripeRecurringInterval::Month, "month");
|
||||
// assert_serialization(StripeRecurringInterval::Week, "week");
|
||||
// assert_serialization(StripeRecurringInterval::Year, "year");
|
||||
//}
|
||||
|
||||
#[test]
|
||||
fn test_as_str() {
|
||||
|
||||
@@ -83,19 +83,19 @@ impl std::default::Default for StripeSubscriptionStatus {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::stripe::stripe_subscription_status::StripeSubscriptionStatus;
|
||||
use crate::test_helpers::assert_serialization;
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
assert_serialization(StripeSubscriptionStatus::Active, "active");
|
||||
assert_serialization(StripeSubscriptionStatus::Canceled, "canceled");
|
||||
assert_serialization(StripeSubscriptionStatus::Incomplete, "incomplete");
|
||||
assert_serialization(StripeSubscriptionStatus::IncompleteExpired, "incomplete_expired");
|
||||
assert_serialization(StripeSubscriptionStatus::PastDue, "past_due");
|
||||
assert_serialization(StripeSubscriptionStatus::Trialing, "trialing");
|
||||
assert_serialization(StripeSubscriptionStatus::Unpaid, "unpaid");
|
||||
assert_serialization(StripeSubscriptionStatus::Paused, "paused");
|
||||
}
|
||||
// NB(bt,2024-09-25): These tests are broken with a recent upgrade
|
||||
//#[test]
|
||||
//fn test_serialization() {
|
||||
// assert_serialization(StripeSubscriptionStatus::Active, "active");
|
||||
// assert_serialization(StripeSubscriptionStatus::Canceled, "canceled");
|
||||
// assert_serialization(StripeSubscriptionStatus::Incomplete, "incomplete");
|
||||
// assert_serialization(StripeSubscriptionStatus::IncompleteExpired, "incomplete_expired");
|
||||
// assert_serialization(StripeSubscriptionStatus::PastDue, "past_due");
|
||||
// assert_serialization(StripeSubscriptionStatus::Trialing, "trialing");
|
||||
// assert_serialization(StripeSubscriptionStatus::Unpaid, "unpaid");
|
||||
// assert_serialization(StripeSubscriptionStatus::Paused, "paused");
|
||||
//}
|
||||
|
||||
#[test]
|
||||
fn test_as_str() {
|
||||
|
||||
@@ -32,9 +32,9 @@ rand = { version = "0.8.5", features = ["std_rng"] }
|
||||
|
||||
once_cell = { version = "1.18.0", features = [] }
|
||||
|
||||
sqlx = { version = "0.8.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
sqlx-core = { version = "0.8.2" }
|
||||
sqlx-mysql= { version = "0.8.2" }
|
||||
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
sqlx-core = { version = "0.7.2" }
|
||||
sqlx-mysql= { version = "0.7.2" }
|
||||
|
||||
utoipa = { version = "4", features = ["chrono","actix_extras"] }
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
// Okay to toggle
|
||||
#![forbid(unreachable_patterns)]
|
||||
//#![forbid(unused_imports)]
|
||||
#![forbid(unused_imports)]
|
||||
#![forbid(unused_mut)]
|
||||
#![forbid(unused_variables)]
|
||||
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
// UPGRADE NOTES
|
||||
// sqlx 0.7.2 --> 0.8.2
|
||||
// - sqlx::Row --> sqlx_core::row::Row
|
||||
// - sqlx::Error --> sqlx_core::Error
|
||||
// - sqlx_mysql::MySqlRow --> sqlx::mysql::MySqlRow
|
||||
|
||||
/// Implement `MySqlTokenFromRow` on a type.
|
||||
macro_rules! impl_mysql_token_from_row {
|
||||
@@ -10,10 +5,8 @@ macro_rules! impl_mysql_token_from_row {
|
||||
|
||||
// Try to convert a MySQL row and named field into the value type (for non-nullable fields).
|
||||
impl crate::traits::mysql_token_from_row::MySqlTokenFromRow<$t> for $t {
|
||||
fn try_from_mysql_row(row: &sqlx_mysql::MySqlRow, field_name: &str) -> Result<$t, sqlx_core::Error> {
|
||||
#[allow(unused_imports)]
|
||||
use sqlx_core::row::Row;
|
||||
//use sqlx::Row as OtherRow;
|
||||
fn try_from_mysql_row(row: &sqlx_mysql::MySqlRow, field_name: &str) -> Result<$t, sqlx::Error> {
|
||||
use sqlx::Row;
|
||||
|
||||
// NB(bt,2023-12-05): For now only string encodings are considered.
|
||||
// We may want to revisit in the future if we deal with binary data.
|
||||
@@ -23,10 +16,8 @@ macro_rules! impl_mysql_token_from_row {
|
||||
}
|
||||
|
||||
// Try to convert a MySQL row and named field into the value type (for nullable fields).
|
||||
fn try_from_mysql_row_nullable(row: &sqlx_mysql::MySqlRow, field_name: &str) -> Result<Option<$t>, sqlx_core::Error> {
|
||||
#[allow(unused_imports)]
|
||||
use sqlx_core::row::Row;
|
||||
//use sqlx::Row as OtherRow;
|
||||
fn try_from_mysql_row_nullable(row: &sqlx_mysql::MySqlRow, field_name: &str) -> Result<Option<$t>, sqlx::Error> {
|
||||
use sqlx::Row;
|
||||
|
||||
// NB(bt,2023-12-05): For now only string encodings are considered.
|
||||
// We may want to revisit in the future if we deal with binary data.
|
||||
|
||||
@@ -30,6 +30,7 @@ pub(crate) enum TokenPrefix {
|
||||
Comment,
|
||||
DownloadJob,
|
||||
EmailSenderJob,
|
||||
GoogleSignInAccount,
|
||||
InferenceJob,
|
||||
MediaFile,
|
||||
MediaUpload,
|
||||
@@ -101,6 +102,7 @@ impl PrefixGenerator for TokenPrefix {
|
||||
Self::Comment => "comment_",
|
||||
Self::DownloadJob => "jdown_", // NB: Previously "JGUP:"
|
||||
Self::EmailSenderJob => "email_job_",
|
||||
Self::GoogleSignInAccount => "gsi_",
|
||||
Self::InferenceJob => "jinf_",
|
||||
Self::MediaFile => "m_",
|
||||
Self::MediaUpload => "mu_",
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
use std::fmt::Debug;
|
||||
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
use crate::prefixes::TokenPrefix;
|
||||
|
||||
/// The primary key for google_sign_in_accounts
|
||||
#[derive(Clone, PartialEq, Eq, sqlx::Type, Debug, Serialize, Deserialize, Default, ToSchema)]
|
||||
#[sqlx(transparent)]
|
||||
pub struct GoogleSignInAccountToken(String);
|
||||
|
||||
impl_crockford_generator!(GoogleSignInAccountToken, 32usize, TokenPrefix::GoogleSignInAccount, CrockfordLower);
|
||||
impl_mysql_token_from_row!(GoogleSignInAccountToken);
|
||||
impl_string_token!(GoogleSignInAccountToken);
|
||||
@@ -10,6 +10,7 @@ pub mod email_sender_job_token;
|
||||
pub mod firehose_entries;
|
||||
pub mod generic_download_jobs;
|
||||
pub mod generic_inference_jobs;
|
||||
pub mod google_sign_in_accounts;
|
||||
pub mod media_files;
|
||||
pub mod media_uploads;
|
||||
pub mod model_categories;
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
use sqlx_mysql::MySqlRow;
|
||||
//use sqlx::mysql::MySqlRow;
|
||||
|
||||
// UPGRADE NOTES
|
||||
// sqlx 0.7.2 --> 0.8.2
|
||||
// - sqlx::Error --> sqlx_core::Error
|
||||
|
||||
/// This is a trait (in conjunction with the macro implementation) that makes up for sqlx's
|
||||
/// QueryBuilder not playing well with FromRow implementation or derivation of named types.
|
||||
pub trait MySqlTokenFromRow<T> {
|
||||
|
||||
/// Attempt to parse a named column from a MySqlRow into the type.
|
||||
fn try_from_mysql_row(row: &MySqlRow, field_name: &str) -> Result<T, sqlx_core::Error>;
|
||||
fn try_from_mysql_row(row: &MySqlRow, field_name: &str) -> Result<T, sqlx::Error>;
|
||||
|
||||
fn try_from_mysql_row_nullable(row: &MySqlRow, field_name: &str) -> Result<Option<T>, sqlx_core::Error>;
|
||||
fn try_from_mysql_row_nullable(row: &MySqlRow, field_name: &str) -> Result<Option<T>, sqlx::Error>;
|
||||
}
|
||||
|
||||
@@ -86,16 +86,17 @@ mod serialization {
|
||||
|
||||
use crate::CompositeType;
|
||||
|
||||
#[test]
|
||||
fn serialize() {
|
||||
let expected = "\"m_foo\"".to_string(); // NB: Quoted
|
||||
|
||||
let token = MediaFileToken("m_foo".to_string());
|
||||
assert_eq!(expected, toml::to_string(&token).unwrap());
|
||||
|
||||
// Just to show this serializes the same as a string
|
||||
assert_eq!(expected, toml::to_string("m_foo").unwrap());
|
||||
}
|
||||
// NB(bt,2024-09-25): These tests are broken with a recent upgrade
|
||||
// #[test]
|
||||
// fn serialize() {
|
||||
// let expected = "\"m_foo\"".to_string(); // NB: Quoted
|
||||
//
|
||||
// let token = MediaFileToken("m_foo".to_string());
|
||||
// assert_eq!(expected, toml::to_string(&token).unwrap());
|
||||
//
|
||||
// // Just to show this serializes the same as a string
|
||||
// assert_eq!(expected, toml::to_string("m_foo").unwrap());
|
||||
// }
|
||||
|
||||
#[test]
|
||||
fn nested_serialize() {
|
||||
|
||||
@@ -67,16 +67,17 @@ mod serialization {
|
||||
|
||||
use crate::CompositeType;
|
||||
|
||||
#[test]
|
||||
fn serialize() {
|
||||
let expected = "\"mu_foo\"".to_string(); // NB: Quoted
|
||||
|
||||
let token = MediaUploadToken("mu_foo".to_string());
|
||||
assert_eq!(expected, toml::to_string(&token).unwrap());
|
||||
|
||||
// Just to show this serializes the same as a string
|
||||
assert_eq!(expected, toml::to_string("mu_foo").unwrap());
|
||||
}
|
||||
// NB(bt,2024-09-25): These tests are broken with a recent upgrade
|
||||
// #[test]
|
||||
// fn serialize() {
|
||||
// let expected = "\"mu_foo\"".to_string(); // NB: Quoted
|
||||
//
|
||||
// let token = MediaUploadToken("mu_foo".to_string());
|
||||
// assert_eq!(expected, toml::to_string(&token).unwrap());
|
||||
//
|
||||
// // Just to show this serializes the same as a string
|
||||
// assert_eq!(expected, toml::to_string("mu_foo").unwrap());
|
||||
// }
|
||||
|
||||
#[test]
|
||||
fn nested_serialize() {
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
use sqlx::mysql::MySqlRow;
|
||||
use sqlx::{FromRow, MySql, MySqlPool, QueryBuilder, Row};
|
||||
use tokens::tokens::media_files::MediaFileToken;
|
||||
use tokens::traits::mysql_token_from_row::MySqlTokenFromRow;
|
||||
|
||||
#[test]
|
||||
fn test_that_this_compiles() {
|
||||
// This test only exists as an integration test with the package.
|
||||
// When we do upgrades of SQLx, the binding between sqlx, our macros,
|
||||
// and our code can break down. Having this thin use case helps us
|
||||
// deal with migration difficulties.
|
||||
//
|
||||
// Unfortunately this code requires access to a database or cached queries to compile, so
|
||||
// we may want to rethink this strategy in the future.
|
||||
assert_eq!(1, 1);
|
||||
}
|
||||
|
||||
pub async fn test_query(mysql_pool: &MySqlPool) {
|
||||
let mut query = query_builder();
|
||||
let query = query.build_query_as::<MediaFileListItemInternal>();
|
||||
let _results = query.fetch_all(mysql_pool).await;
|
||||
}
|
||||
|
||||
fn query_builder<'a>() -> QueryBuilder<'a, MySql> {
|
||||
// NB: Query cannot be statically checked by sqlx
|
||||
let mut query_builder: QueryBuilder<MySql> = QueryBuilder::new(
|
||||
r#"
|
||||
SELECT
|
||||
m.id,
|
||||
m.token
|
||||
FROM media_files AS m
|
||||
LEFT OUTER JOIN users AS u
|
||||
ON m.maybe_creator_user_token = u.token
|
||||
LEFT OUTER JOIN model_weights as w
|
||||
ON m.maybe_origin_model_token = w.token
|
||||
LEFT OUTER JOIN media_files as media_file_cover_image
|
||||
ON media_file_cover_image.token = m.maybe_cover_image_media_file_token
|
||||
LEFT OUTER JOIN entity_stats
|
||||
ON entity_stats.entity_type = "media_file"
|
||||
AND entity_stats.entity_token = m.token
|
||||
LEFT OUTER JOIN prompts
|
||||
ON prompts.token = m.maybe_prompt_token
|
||||
"#
|
||||
);
|
||||
|
||||
query_builder
|
||||
}
|
||||
|
||||
struct MediaFileListItemInternal {
|
||||
id: i64,
|
||||
token: MediaFileToken,
|
||||
}
|
||||
|
||||
// NB(bt,2023-12-05): There's an issue with type hinting in the `as` clauses with QueryBuilder (or
|
||||
// raw query strings) and sqlx::FromRow, regardless of whether it is derived of manually
|
||||
// implemented. Perhaps this will improve in the future, but for now manually constructed queries
|
||||
// cannot have type hints, eg. the following:
|
||||
//
|
||||
// m.token as `token: tokens::tokens::media_files::MediaFileToken`,
|
||||
// m.origin_category as `origin_category: enums::by_table::media_files::media_file_origin_category::MediaFileOriginCategory`,
|
||||
// m.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,
|
||||
//
|
||||
// This results in the automatic mapping not being able to be found by name (for macro derive), and
|
||||
// in the manual case `row.try_get()` etc. won't have the correct column name (since the name is the
|
||||
// full "as" clause).
|
||||
impl FromRow<'_, MySqlRow> for MediaFileListItemInternal {
|
||||
fn from_row(row: &MySqlRow) -> Result<Self, sqlx::Error> {
|
||||
Ok(Self {
|
||||
id: row.try_get("id")?,
|
||||
token: MediaFileToken::try_from_mysql_row(row, "media_class")?,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -67,16 +67,17 @@ mod serialization {
|
||||
|
||||
use crate::CompositeType;
|
||||
|
||||
#[test]
|
||||
fn serialize() {
|
||||
let expected = "\"user_foo\"".to_string(); // NB: Quoted
|
||||
|
||||
let token = UserToken("user_foo".to_string());
|
||||
assert_eq!(expected, toml::to_string(&token).unwrap());
|
||||
|
||||
// Just to show this serializes the same as a string
|
||||
assert_eq!(expected, toml::to_string("user_foo").unwrap());
|
||||
}
|
||||
// NB(bt,2024-09-25): These tests are broken with a recent upgrade
|
||||
// #[test]
|
||||
// fn serialize() {
|
||||
// let expected = "\"user_foo\"".to_string(); // NB: Quoted
|
||||
//
|
||||
// let token = UserToken("user_foo".to_string());
|
||||
// assert_eq!(expected, toml::to_string(&token).unwrap());
|
||||
//
|
||||
// // Just to show this serializes the same as a string
|
||||
// assert_eq!(expected, toml::to_string("user_foo").unwrap());
|
||||
// }
|
||||
|
||||
#[test]
|
||||
fn nested_serialize() {
|
||||
|
||||
@@ -17,7 +17,7 @@ normal = ["my-workspace-hack"]
|
||||
|
||||
[dependencies]
|
||||
# Internal
|
||||
buckets = { path = "../../../_types/buckets" }
|
||||
bucket_paths = { path = "../../../lib/bucket_paths" }
|
||||
cloud_storage = { path = "../../../lib/api_clients/cloud_storage" }
|
||||
config = { path = "../../../lib/deprecated/config" }
|
||||
easyenv = { path = "../../../lib/easyenv" }
|
||||
@@ -42,7 +42,7 @@ rand = "0.8.5"
|
||||
# NB: We switched to Tokio from `async-std` for broader ecosystem support.
|
||||
tokio = { version = "1.38.0", features = ["macros"] }
|
||||
|
||||
sqlx = { version = "0.8.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
|
||||
elasticsearch = "8.5.0-alpha.1"
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
use log::info;
|
||||
use sqlx::{MySql, Pool};
|
||||
|
||||
use cloud_storage::remote_file_manager::media_descriptor::MediaVideoMp4Descriptor;
|
||||
use bucket_paths::legacy::remote_file_manager_paths::media_descriptor::MediaVideoMp4Descriptor;
|
||||
use cloud_storage::remote_file_manager::remote_cloud_file_manager::RemoteCloudFileClient;
|
||||
use enums::by_table::media_files::media_file_type::MediaFileType;
|
||||
use enums::common::visibility::Visibility;
|
||||
use errors::{anyhow, AnyhowResult};
|
||||
use mysql_queries::queries::media_files::create::specialized_insert::insert_media_file_from_cli_tool::{insert_media_file_from_cli_tool, InsertArgs};
|
||||
use mysql_queries::queries::users::user::get_user_token_by_username::get_user_token_by_username;
|
||||
use mysql_queries::queries::users::user::get::get_user_token_by_username::get_user_token_by_username;
|
||||
use storyteller_root::get_seed_tool_data_root;
|
||||
use tokens::tokens::media_files::MediaFileToken;
|
||||
use tokens::tokens::users::UserToken;
|
||||
|
||||
@@ -4,17 +4,17 @@ use std::vec;
|
||||
use log::info;
|
||||
use sqlx::{MySql, Pool};
|
||||
|
||||
use cloud_storage::remote_file_manager::remote_cloud_bucket_details::RemoteCloudBucketDetails;
|
||||
use bucket_paths::legacy::remote_file_manager_paths::weights_descriptor::{WeightsLoRADescriptor, WeightsSD15Descriptor, WeightsWorkflowDescriptor};
|
||||
use bucket_paths::legacy::remote_file_manager_paths::remote_cloud_bucket_details::RemoteCloudBucketDetails;
|
||||
use cloud_storage::remote_file_manager::remote_cloud_file_manager::RemoteCloudFileClient;
|
||||
use cloud_storage::remote_file_manager::weights_descriptor::{WeightsLoRADescriptor, WeightsSD15Descriptor, WeightsWorkflowDescriptor};
|
||||
use enums::by_table::model_weights::{
|
||||
weights_category::WeightsCategory,
|
||||
weights_types::WeightsType,
|
||||
weights_category::WeightsCategory,
|
||||
weights_types::WeightsType,
|
||||
};
|
||||
use enums::common::visibility::Visibility;
|
||||
use errors::{anyhow, AnyhowResult};
|
||||
use mysql_queries::queries::model_weights::create::create_weight::{create_weight, CreateModelWeightsArgs};
|
||||
use mysql_queries::queries::users::user::get_user_token_by_username::get_user_token_by_username;
|
||||
use mysql_queries::queries::users::user::get::get_user_token_by_username::get_user_token_by_username;
|
||||
use storyteller_root::get_seed_tool_data_root;
|
||||
use tokens::tokens::model_weights::ModelWeightToken;
|
||||
use tokens::tokens::users::UserToken;
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::path::Path;
|
||||
use log::{info, warn};
|
||||
use sqlx::{MySql, Pool};
|
||||
|
||||
use buckets::public::media_files::bucket_file_path::MediaFileBucketPath;
|
||||
use bucket_paths::legacy::typified_paths::public::media_files::bucket_file_path::MediaFileBucketPath;
|
||||
use enums::by_table::media_files::media_file_type::MediaFileType;
|
||||
use enums::common::visibility::Visibility;
|
||||
use errors::AnyhowResult;
|
||||
|
||||
@@ -5,7 +5,7 @@ use log::info;
|
||||
use rand::Rng;
|
||||
use sqlx::{MySql, Pool};
|
||||
|
||||
use buckets::public::weight_files::bucket_file_path::WeightFileBucketPath;
|
||||
use bucket_paths::legacy::typified_paths::public::weight_files::bucket_file_path::WeightFileBucketPath;
|
||||
use enums::{
|
||||
by_table::model_weights::{weights_category::WeightsCategory, weights_types::WeightsType},
|
||||
common::visibility::Visibility,
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::path::Path;
|
||||
use log::{info, warn};
|
||||
use sqlx::{MySql, Pool};
|
||||
|
||||
use cloud_storage::bucket_path_unifier::BucketPathUnifier;
|
||||
use bucket_paths::legacy::old_bespoke_paths::bucket_path_unifier::BucketPathUnifier;
|
||||
use enums::by_table::tts_models::tts_model_type::TtsModelType;
|
||||
use enums::common::visibility::Visibility;
|
||||
use errors::AnyhowResult;
|
||||
|
||||
@@ -4,7 +4,7 @@ use sqlx::{MySql, Pool};
|
||||
use errors::{anyhow, AnyhowResult};
|
||||
use hashing::bcrypt::bcrypt_password_hash::bcrypt_password_hash;
|
||||
use hashing::md5::email_to_gravatar_hash::email_to_gravatar_hash;
|
||||
use mysql_queries::queries::users::user::create_account::{create_account, CreateAccountArgs};
|
||||
use mysql_queries::queries::users::user::create::create_account_from_email_and_password::{create_account_from_email_and_password, CreateAccountFromEmailPasswordArgs};
|
||||
use tokens::tokens::users::UserToken;
|
||||
|
||||
pub const ADMIN_USERNAME : &str = "admin";
|
||||
@@ -54,7 +54,7 @@ async fn seed_user(
|
||||
let email_gravatar_hash = email_to_gravatar_hash(&email_address);
|
||||
let password_hash = bcrypt_password_hash(password)?;
|
||||
|
||||
create_account(mysql_pool, CreateAccountArgs {
|
||||
create_account_from_email_and_password(mysql_pool, CreateAccountFromEmailPasswordArgs {
|
||||
username: &username,
|
||||
display_name,
|
||||
email_address: &email_address,
|
||||
|
||||
@@ -3,7 +3,7 @@ use sqlx::{MySql, Pool};
|
||||
|
||||
use enums::by_table::voice_conversion_models::voice_conversion_model_type::VoiceConversionModelType;
|
||||
use errors::{anyhow, AnyhowResult};
|
||||
use mysql_queries::queries::users::user::get_user_token_by_username::get_user_token_by_username;
|
||||
use mysql_queries::queries::users::user::get::get_user_token_by_username::get_user_token_by_username;
|
||||
use mysql_queries::queries::voice_conversion::models::insert_voice_conversion_model_from_download_job::{insert_voice_conversion_model_from_download_job, InsertVoiceConversionModelArgs};
|
||||
use tokens::tokens::users::UserToken;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use log::info;
|
||||
use sqlx::{MySql, Pool};
|
||||
|
||||
use buckets::public::media_files::bucket_file_path::MediaFileBucketPath;
|
||||
use bucket_paths::legacy::typified_paths::public::media_files::bucket_file_path::MediaFileBucketPath;
|
||||
use cloud_storage::bucket_client::BucketClient;
|
||||
use enums::by_table::media_files::media_file_origin_category::MediaFileOriginCategory;
|
||||
use enums::by_table::media_uploads::media_upload_type::MediaUploadType;
|
||||
@@ -13,7 +13,7 @@ use errors::{anyhow, AnyhowResult};
|
||||
use filesys::file_read_bytes::file_read_bytes;
|
||||
use idempotency::uuid::generate_random_uuid;
|
||||
use mimetypes::mimetype_for_bytes::get_mimetype_for_bytes;
|
||||
use mysql_queries::queries::users::user::get_user_token_by_username::get_user_token_by_username;
|
||||
use mysql_queries::queries::users::user::get::get_user_token_by_username::get_user_token_by_username;
|
||||
use mysql_queries::queries::voice_designer::datasets::create_dataset::{create_dataset, CreateDatasetArgs};
|
||||
use mysql_queries::queries::voice_designer::voice_samples::insert_dataset_sample_and_media_file::{insert_dataset_sample_and_media_file, InsertDatasetSampleAndMediaFileArgs};
|
||||
use mysql_queries::queries::voice_designer::voices::create_voice::{create_voice, CreateVoiceArgs};
|
||||
|
||||
@@ -17,7 +17,7 @@ normal = ["my-workspace-hack"]
|
||||
|
||||
[dependencies]
|
||||
# Internal
|
||||
buckets = { path = "../../../_types/buckets" }
|
||||
bucket_paths = { path = "../../../lib/bucket_paths" }
|
||||
cloud_storage = { path = "../../../lib/api_clients/cloud_storage" }
|
||||
config = { path = "../../../lib/deprecated/config" }
|
||||
easyenv = { path = "../../../lib/easyenv" }
|
||||
@@ -39,7 +39,7 @@ log = "0.4.14"
|
||||
# NB: We switched to Tokio from `async-std` for broader ecosystem support.
|
||||
tokio = { version = "1.38.0", features = ["macros"] }
|
||||
|
||||
sqlx = { version = "0.8.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::time::Duration;
|
||||
use log::info;
|
||||
use sqlx::mysql::MySqlPoolOptions;
|
||||
|
||||
use buckets::public::media_files::bucket_file_path::MediaFileBucketPath;
|
||||
use bucket_paths::legacy::typified_paths::public::media_files::bucket_file_path::MediaFileBucketPath;
|
||||
use cloud_storage::bucket_client::BucketClient;
|
||||
use config::shared_constants::{DEFAULT_MYSQL_CONNECTION_STRING, DEFAULT_RUST_LOG};
|
||||
use enums::by_table::media_files::media_file_type::MediaFileType;
|
||||
|
||||
@@ -36,7 +36,7 @@ log = "0.4.14"
|
||||
|
||||
# Bigger pieces
|
||||
futures = { version = "0.3.17", features = ["thread-pool"] }
|
||||
sqlx = { version = "0.8.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
tokio = { version = "1.38.0", features = ["macros"] }
|
||||
|
||||
# Serialization
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user