mirror of
https://github.com/Syfaro/fuzzysearch.git
synced 2024-11-05 06:23:08 +00:00
188 lines
7.3 KiB
JSON
188 lines
7.3 KiB
JSON
{
|
|
"db": "PostgreSQL",
|
|
"1984ce60f052d6a29638f8e05b35671b8edfbf273783d4b843ebd35cbb8a391f": {
|
|
"query": "INSERT INTO\n rate_limit (api_key_id, time_window, group_name, count)\n VALUES\n ($1, $2, $3, $4)\n ON CONFLICT ON CONSTRAINT unique_window\n DO UPDATE set count = rate_limit.count + $4\n RETURNING rate_limit.count",
|
|
"describe": {
|
|
"columns": [
|
|
{
|
|
"ordinal": 0,
|
|
"name": "count",
|
|
"type_info": "Int2"
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Left": [
|
|
"Int4",
|
|
"Int8",
|
|
"Text",
|
|
"Int2"
|
|
]
|
|
},
|
|
"nullable": [
|
|
false
|
|
]
|
|
}
|
|
},
|
|
"659ee9ddc1c5ccd42ba9dc1617440544c30ece449ba3ba7f9d39f447b8af3cfe": {
|
|
"query": "SELECT\n api_key.id,\n api_key.name_limit,\n api_key.image_limit,\n api_key.hash_limit,\n api_key.name,\n account.email owner_email\n FROM\n api_key\n JOIN account\n ON account.id = api_key.user_id\n WHERE\n api_key.key = $1\n ",
|
|
"describe": {
|
|
"columns": [
|
|
{
|
|
"ordinal": 0,
|
|
"name": "id",
|
|
"type_info": "Int4"
|
|
},
|
|
{
|
|
"ordinal": 1,
|
|
"name": "name_limit",
|
|
"type_info": "Int2"
|
|
},
|
|
{
|
|
"ordinal": 2,
|
|
"name": "image_limit",
|
|
"type_info": "Int2"
|
|
},
|
|
{
|
|
"ordinal": 3,
|
|
"name": "hash_limit",
|
|
"type_info": "Int2"
|
|
},
|
|
{
|
|
"ordinal": 4,
|
|
"name": "name",
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"ordinal": 5,
|
|
"name": "owner_email",
|
|
"type_info": "Text"
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Left": [
|
|
"Text"
|
|
]
|
|
},
|
|
"nullable": [
|
|
false,
|
|
false,
|
|
false,
|
|
false,
|
|
true,
|
|
false
|
|
]
|
|
}
|
|
},
|
|
"6b8d304fc40fa539ae671e6e24e7978ad271cb7a1cafb20fc4b4096a958d790f": {
|
|
"query": "SELECT exists(SELECT 1 FROM twitter_user WHERE lower(data->>'screen_name') = lower($1))",
|
|
"describe": {
|
|
"columns": [
|
|
{
|
|
"ordinal": 0,
|
|
"name": "exists",
|
|
"type_info": "Bool"
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Left": [
|
|
"Text"
|
|
]
|
|
},
|
|
"nullable": [
|
|
null
|
|
]
|
|
}
|
|
},
|
|
"fe2100bda3d730a69efcb052ff72029f15603e02f5fb1e59e061935be872f6d6": {
|
|
"query": "WITH hashes AS (\n SELECT * FROM jsonb_to_recordset($1::jsonb)\n AS hashes(searched_hash bigint, found_hash bigint, distance bigint)\n )\n SELECT\n 'FurAffinity' site,\n submission.id,\n submission.hash_int hash,\n submission.url,\n submission.filename,\n ARRAY(SELECT artist.name) artists,\n submission.file_id,\n null sources,\n submission.rating,\n submission.posted_at,\n hashes.searched_hash,\n hashes.distance,\n submission.file_sha256 sha256\n FROM hashes\n JOIN submission ON hashes.found_hash = submission.hash_int\n JOIN artist ON submission.artist_id = artist.id\n WHERE hash_int IN (SELECT hashes.found_hash)\n UNION ALL\n SELECT\n 'e621' site,\n e621.id,\n e621.hash,\n e621.data->'file'->>'url' url,\n (e621.data->'file'->>'md5') || '.' || (e621.data->'file'->>'ext') filename,\n ARRAY(SELECT jsonb_array_elements_text(e621.data->'tags'->'artist')) artists,\n null file_id,\n ARRAY(SELECT jsonb_array_elements_text(e621.data->'sources')) sources,\n e621.data->>'rating' rating,\n to_timestamp(data->>'created_at', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') posted_at,\n hashes.searched_hash,\n hashes.distance,\n e621.sha256\n FROM hashes\n JOIN e621 ON hashes.found_hash = e621.hash\n WHERE e621.hash IN (SELECT hashes.found_hash)\n UNION ALL\n SELECT\n 'Weasyl' site,\n weasyl.id,\n weasyl.hash,\n weasyl.data->>'link' url,\n null filename,\n ARRAY(SELECT weasyl.data->>'owner_login') artists,\n null file_id,\n null sources,\n weasyl.data->>'rating' rating,\n to_timestamp(data->>'posted_at', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') posted_at,\n hashes.searched_hash,\n hashes.distance,\n weasyl.sha256\n FROM hashes\n JOIN weasyl ON hashes.found_hash = weasyl.hash\n WHERE weasyl.hash IN (SELECT hashes.found_hash)\n UNION ALL\n SELECT\n 'Twitter' site,\n tweet.id,\n tweet_media.hash,\n tweet_media.url,\n null filename,\n ARRAY(SELECT tweet.data->'user'->>'screen_name') artists,\n null file_id,\n null sources,\n CASE\n WHEN (tweet.data->'possibly_sensitive')::boolean IS true THEN 'adult'\n WHEN (tweet.data->'possibly_sensitive')::boolean IS false THEN 'general'\n END rating,\n to_timestamp(tweet.data->>'created_at', 'DY Mon DD HH24:MI:SS +0000 YYYY') posted_at,\n hashes.searched_hash,\n hashes.distance,\n null sha256\n FROM hashes\n JOIN tweet_media ON hashes.found_hash = tweet_media.hash\n JOIN tweet ON tweet_media.tweet_id = tweet.id\n WHERE tweet_media.hash IN (SELECT hashes.found_hash)",
|
|
"describe": {
|
|
"columns": [
|
|
{
|
|
"ordinal": 0,
|
|
"name": "site",
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"ordinal": 1,
|
|
"name": "id",
|
|
"type_info": "Int8"
|
|
},
|
|
{
|
|
"ordinal": 2,
|
|
"name": "hash",
|
|
"type_info": "Int8"
|
|
},
|
|
{
|
|
"ordinal": 3,
|
|
"name": "url",
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"ordinal": 4,
|
|
"name": "filename",
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"ordinal": 5,
|
|
"name": "artists",
|
|
"type_info": "TextArray"
|
|
},
|
|
{
|
|
"ordinal": 6,
|
|
"name": "file_id",
|
|
"type_info": "Int4"
|
|
},
|
|
{
|
|
"ordinal": 7,
|
|
"name": "sources",
|
|
"type_info": "TextArray"
|
|
},
|
|
{
|
|
"ordinal": 8,
|
|
"name": "rating",
|
|
"type_info": "Bpchar"
|
|
},
|
|
{
|
|
"ordinal": 9,
|
|
"name": "posted_at",
|
|
"type_info": "Timestamptz"
|
|
},
|
|
{
|
|
"ordinal": 10,
|
|
"name": "searched_hash",
|
|
"type_info": "Int8"
|
|
},
|
|
{
|
|
"ordinal": 11,
|
|
"name": "distance",
|
|
"type_info": "Int8"
|
|
},
|
|
{
|
|
"ordinal": 12,
|
|
"name": "sha256",
|
|
"type_info": "Bytea"
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Left": [
|
|
"Jsonb"
|
|
]
|
|
},
|
|
"nullable": [
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
null
|
|
]
|
|
}
|
|
}
|
|
} |