feat: offline sqlx data
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline failed

This commit is contained in:
Aravinth Manivannan 2023-10-20 01:46:58 +05:30
parent 5e7d1cae65
commit dfa83b1031
Signed by: realaravinth
GPG key ID: F8F50389936984FF
7 changed files with 41 additions and 60 deletions

View file

@ -1,6 +1,6 @@
{ {
"db_name": "PostgreSQL", "db_name": "PostgreSQL",
"query": "SELECT\n synced_till\n FROM\n survey_mcaptcha_campaign\n WHERE \n campaign_id = $1\n AND\n url_id = (\n SELECT ID FROM survey_mcaptcha_hostname WHERE secret = $2\n );", "query": "SELECT\n synced_till\n FROM\n survey_mcaptcha_campaign\n WHERE \n campaign_id = $1;",
"describe": { "describe": {
"columns": [ "columns": [
{ {
@ -11,7 +11,6 @@
], ],
"parameters": { "parameters": {
"Left": [ "Left": [
"Text",
"Text" "Text"
] ]
}, },
@ -19,5 +18,5 @@
false false
] ]
}, },
"hash": "f5c0480ed2829c3a3dbe7a8da2d95b43076b0dd18fe5137d7ba87bc8e56102fe" "hash": "05b7fe6d93a4c988e9eae32f4a57e369f9ddc703b8fd3251c6baa52b60c98a1d"
} }

View file

@ -1,16 +1,15 @@
{ {
"db_name": "PostgreSQL", "db_name": "PostgreSQL",
"query": "UPDATE\n survey_mcaptcha_campaign\n SET\n synced_till = $1\n WHERE \n campaign_id = $2\n AND\n url_id = (\n SELECT ID FROM survey_mcaptcha_hostname WHERE secret = $3\n )\n ", "query": "UPDATE\n survey_mcaptcha_campaign\n SET\n synced_till = $1\n WHERE \n campaign_id = $2; ",
"describe": { "describe": {
"columns": [], "columns": [],
"parameters": { "parameters": {
"Left": [ "Left": [
"Int4", "Int4",
"Text",
"Text" "Text"
] ]
}, },
"nullable": [] "nullable": []
}, },
"hash": "3eb4799231e726cf566f81d6ec7bd30a5c75215dbc3179fae08a106388341c3f" "hash": "163a1ab861234bbf52b1b1c03bbac0d37bbbb539146f93c6fba24ffd80ad1485"
} }

View file

@ -1,22 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT\n url\n FROM\n survey_mcaptcha_hostname\n WHERE\n secret = $1; ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "url",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false
]
},
"hash": "677376147c1346f9136c5d60914efc5062a25eb0ada991f04197189aa6dcb2c4"
}

View file

@ -1,11 +1,10 @@
{ {
"db_name": "PostgreSQL", "db_name": "PostgreSQL",
"query": "INSERT INTO\n survey_mcaptcha_analytics (\n campaign_id, time, difficulty_factor, worker_type\n )\n VALUES ((\n SELECT\n ID\n FROM\n survey_mcaptcha_campaign\n WHERE \n campaign_id = $1\n AND\n url_id = (\n SELECT ID FROM survey_mcaptcha_hostname WHERE secret = $2\n )\n ), $3, $4, $5\n );", "query": "INSERT INTO\n survey_mcaptcha_analytics (\n campaign_id, time, difficulty_factor, worker_type\n )\n VALUES ((\n SELECT\n ID\n FROM\n survey_mcaptcha_campaign\n WHERE \n campaign_id = $1\n ), $2, $3, $4\n );",
"describe": { "describe": {
"columns": [], "columns": [],
"parameters": { "parameters": {
"Left": [ "Left": [
"Text",
"Text", "Text",
"Int4", "Int4",
"Int4", "Int4",
@ -14,5 +13,5 @@
}, },
"nullable": [] "nullable": []
}, },
"hash": "997a3d0ce396d48a1804b6272124f0d8eed367916b28c240551b97aebcc9eb36" "hash": "6c8fda20aa4a9174a5b008032d493773274ebfbf9dc204d89609cdff1ebc0335"
} }

View file

@ -1,28 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT\n survey_mcaptcha_campaign.campaign_id,\n survey_mcaptcha_upload_jobs.public_id\n FROM\n survey_mcaptcha_campaign\n INNER JOIN\n survey_mcaptcha_upload_jobs\n ON\n survey_mcaptcha_upload_jobs.campaign_id = survey_mcaptcha_campaign.ID\n WHERE\n survey_mcaptcha_upload_jobs.job_state = (\n SELECT ID FROM survey_mcaptcha_upload_job_states WHERE name = $1\n )\n AND\n survey_mcaptcha_upload_jobs.finished_at is NULL\n AND\n survey_mcaptcha_upload_jobs.scheduled_at is NULL\n ORDER BY created_at ASC;",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "campaign_id",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "public_id",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false,
false
]
},
"hash": "8be51483900058d0bcc4c121440fe551bc57096826119ad914cc1ef2d9ccb79d"
}

View file

@ -0,0 +1,34 @@
{
"db_name": "PostgreSQL",
"query": "SELECT\n survey_mcaptcha_campaign.campaign_id,\n survey_mcaptcha_upload_jobs.public_id,\n survey_mcaptcha_hostname.url\n FROM\n survey_mcaptcha_campaign\n INNER JOIN\n survey_mcaptcha_upload_jobs\n ON\n survey_mcaptcha_upload_jobs.campaign_id = survey_mcaptcha_campaign.ID\n INNER JOIN\n survey_mcaptcha_hostname\n ON\n survey_mcaptcha_hostname.ID = survey_mcaptcha_campaign.url_id\n WHERE\n survey_mcaptcha_upload_jobs.job_state = (\n SELECT ID FROM survey_mcaptcha_upload_job_states WHERE name = $1\n )\n AND\n survey_mcaptcha_upload_jobs.finished_at is NULL\n AND\n survey_mcaptcha_upload_jobs.scheduled_at is NULL\n ORDER BY created_at ASC;",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "campaign_id",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "public_id",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "url",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false,
false,
false
]
},
"hash": "d7a099c6f381fd02ad6a114b0146e4e52f7886f0164d05ccd3f1818a2a70cf67"
}

View file

@ -129,7 +129,7 @@ async fn download(
mod tests { mod tests {
use crate::api::v1::get_random; use crate::api::v1::get_random;
use crate::mcaptcha::PerformanceAnalytics; use crate::mcaptcha::PerformanceAnalytics;
use crate::mcaptcha::Secret; use super::Secret;
use crate::tests::*; use crate::tests::*;
use crate::*; use crate::*;