mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-03 00:47:53 +00:00
codegen db
This commit is contained in:
1 parent
0cee5e5fcc
commit
7df5dc63ce
4 files changed
+87
-3
No files matched your search
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\n UPDATE model_weights\n SET\n cached_usage_count = ?\n WHERE token = ?\n LIMIT 1\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "0cedb218ebd5b30e04852e3f62ac2811c3f208a7fd7c4e46a270913dde4bfa2b"
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nSELECT\n sum(usage_count) as total_usage_count\nFROM\n model_weight_usage_counts\nWHERE\n token = ?\nGROUP BY token\nLIMIT 1\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "total_usage_count",
|
||||
"type_info": {
|
||||
"type": "NewDecimal",
|
||||
"flags": "BINARY",
|
||||
"char_set": 63,
|
||||
"max_size": 33
|
||||
}
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "5c95ce504e15853d238e8133753efe45180c9ee57f9f5431be9c1e88a77e4824"
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\n SELECT\n token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n cached_usage_count\n FROM model_weights\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "token: tokens::tokens::model_weights::ModelWeightToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
"char_set": 224,
|
||||
"max_size": 128
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "cached_usage_count",
|
||||
"type_info": {
|
||||
"type": "LongLong",
|
||||
"flags": "NOT_NULL | UNSIGNED",
|
||||
"char_set": 63,
|
||||
"max_size": 20
|
||||
}
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "5f24dfda13a53f434f87e9826a3a943bf29f58d85a6efb35c1b9ea9e94785ec9"
|
||||
}
|
||||
+14
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nSELECT\n distinct coalesce(w.token, w_old.token) as token,\n COUNT(*) as usage_count\nFROM\n media_files as f\nLEFT OUTER JOIN model_weights as w\n ON f.maybe_origin_model_token = w.token\nLEFT OUTER JOIN model_weights as w_old\n ON f.maybe_origin_model_token = w_old.maybe_migration_old_model_token\nWHERE f.maybe_origin_model_token IS NOT NULL\n AND f.created_at >= ?\n AND f.created_at < ? + INTERVAL 1 DAY\nGROUP BY coalesce(w.token, w_old.token)\nORDER BY usage_count DESC\n ",
|
||||
"query": "\nSELECT\n distinct coalesce(w.token, w_old.token) as token,\n mwuc.usage_count as maybe_previously_cached_model_use_count,\n COUNT(*) as usage_count\nFROM\n media_files as f\nLEFT OUTER JOIN model_weights as w\n ON f.maybe_origin_model_token = w.token\nLEFT OUTER JOIN model_weights as w_old\n ON f.maybe_origin_model_token = w_old.maybe_migration_old_model_token\nLEFT OUTER JOIN model_weight_usage_counts as mwuc\n ON coalesce(w.token, w_old.token) = mwuc.token\n AND mwuc.on_date = ?\nWHERE f.maybe_origin_model_token IS NOT NULL\n AND f.created_at >= ?\n AND f.created_at < ? + INTERVAL 1 DAY\nGROUP BY coalesce(w.token, w_old.token), mwuc.usage_count\nORDER BY usage_count DESC\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -15,6 +15,16 @@
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "maybe_previously_cached_model_use_count",
|
||||
"type_info": {
|
||||
"type": "Long",
|
||||
"flags": "MULTIPLE_KEY | UNSIGNED",
|
||||
"char_set": 63,
|
||||
"max_size": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "usage_count",
|
||||
"type_info": {
|
||||
"type": "LongLong",
|
||||
@@ -25,12 +35,13 @@
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
true,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "3b9302fcc4d873e2bca9cbe74864b82ba2065131075e4caefbfdcf4806d56f83"
|
||||
"hash": "9e99e21963271f4ab229a9efba566340ce1a33375762cc140f941885f2772cfb"
|
||||
}
|
||||
Reference in new issue
Block a user