Skip to content

Commit

Permalink
replace offline sqlx
Browse files Browse the repository at this point in the history
  • Loading branch information
leshow committed Oct 13, 2024
1 parent 3d9688a commit dd45079
Showing 1 changed file with 126 additions and 78 deletions.
204 changes: 126 additions & 78 deletions libs/ip-manager/sqlx-data.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
{
"db": "SQLite",
"0ed87a7db669b203bea70d30069fd27c97d74931053e69d39d5487075d575976": {
"describe": {
"columns": [
{
"name": "ip",
"ordinal": 0,
"type_info": "Int64"
}
],
"nullable": [
false
],
"parameters": {
"Right": 2
}
},
"query": "SELECT ip\n FROM\n leases\n WHERE\n client_id = ?1 AND expires_at > ?2\n LIMIT 1"
},
"47c078186e966aa9ce236a2e0e54edf870cf6cbca6fbb20eb0896675be9347f3": {
"query": "SELECT * FROM leases WHERE ip = ?1",
"describe": {
"columns": [
{
Expand Down Expand Up @@ -35,21 +52,21 @@
"type_info": "Bool"
}
],
"parameters": {
"Right": 1
},
"nullable": [
false,
true,
false,
false,
false,
false
]
}
],
"parameters": {
"Right": 1
}
},
"query": "SELECT * FROM leases WHERE ip = ?1"
},
"793f1692b36d96a6815c6bfb21d5de88c4f64c020af406405a2ed8c9535ffff3": {
"query": "SELECT COUNT(ip) as count_ip FROM leases WHERE leased = ?1 AND probation = ?2 AND expires_at > ?3",
"describe": {
"columns": [
{
Expand All @@ -58,26 +75,74 @@
"type_info": "Int"
}
],
"nullable": [
false
],
"parameters": {
"Right": 3
},
}
},
"query": "SELECT COUNT(ip) as count_ip FROM leases WHERE leased = ?1 AND probation = ?2 AND expires_at > ?3"
},
"79f533ff7a523b1e305075de57b772e8728a5c76e21cd256d88303b86585ba0d": {
"describe": {
"columns": [
{
"name": "ip",
"ordinal": 0,
"type_info": "Int64"
},
{
"name": "client_id",
"ordinal": 1,
"type_info": "Blob"
},
{
"name": "leased",
"ordinal": 2,
"type_info": "Bool"
},
{
"name": "expires_at",
"ordinal": 3,
"type_info": "Int64"
},
{
"name": "network",
"ordinal": 4,
"type_info": "Int64"
},
{
"name": "probation",
"ordinal": 5,
"type_info": "Bool"
}
],
"nullable": [
false,
true,
false,
false,
false,
false
]
}
],
"parameters": {
"Right": 5
}
},
"query": "\n UPDATE leases\n SET\n client_id = ?2, expires_at = ?3, leased = ?4, probation = ?5\n WHERE\n ip = ?1\n RETURNING *\n "
},
"7a75f6b16faff6ed52e5d49bf639d27e8cbabd72922a6ecebecddc5810ad5e2d": {
"query": "INSERT INTO leases\n (ip, client_id, expires_at, network, leased, probation)\n VALUES\n (?1, ?2, ?3, ?4, ?5, ?6)",
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Right": 6
},
"nullable": []
}
}
},
"query": "INSERT INTO leases\n (ip, client_id, expires_at, network, leased, probation)\n VALUES\n (?1, ?2, ?3, ?4, ?5, ?6)"
},
"882703a86e74138d6b6f7e58219890fbf40508e6212ba0aa6e507b1f1c9ad1f4": {
"query": "\n UPDATE leases\n SET\n client_id = ?4, leased = ?5, expires_at = ?6, probation = FALSE\n WHERE ip in\n (\n SELECT ip\n FROM leases\n WHERE\n ((expires_at < ?1) AND (ip >= ?2 AND ip <= ?3)) OR (client_id = ?4)\n ORDER BY ip LIMIT 1\n )\n RETURNING ip\n ",
"describe": {
"columns": [
{
Expand All @@ -86,16 +151,16 @@
"type_info": "Int64"
}
],
"parameters": {
"Right": 6
},
"nullable": [
false
]
}
],
"parameters": {
"Right": 6
}
},
"query": "\n UPDATE leases\n SET\n client_id = ?4, leased = ?5, expires_at = ?6, probation = FALSE\n WHERE ip in\n (\n SELECT ip\n FROM leases\n WHERE\n ((expires_at < ?1) AND (ip >= ?2 AND ip <= ?3)) OR (client_id = ?4)\n ORDER BY ip LIMIT 1\n )\n RETURNING ip\n "
},
"a9016b83146975088fb6d81b9e9f279cd5f8f697a3720e4a0a9394ecb91a0a5e": {
"query": "\n UPDATE leases\n SET\n client_id = ?2, leased = ?4, expires_at = ?5, probation = ?6\n WHERE ip in\n (\n SELECT ip\n FROM leases\n WHERE\n ((client_id = ?2 AND ip = ?3) \n OR (expires_at < ?1 AND ip = ?3))\n ORDER BY ip LIMIT 1\n )\n RETURNING ip\n ",
"891fc8512be79fc824f7ff618c343d21ad22ebc067474065839d143257bee20c": {
"describe": {
"columns": [
{
Expand All @@ -104,16 +169,16 @@
"type_info": "Int64"
}
],
"parameters": {
"Right": 6
},
"nullable": [
false
]
}
],
"parameters": {
"Right": 6
}
},
"query": "\n UPDATE leases\n SET\n client_id = ?2, leased = ?4, expires_at = ?5, probation = ?6\n WHERE ip in\n (\n SELECT ip\n FROM leases\n WHERE\n ((client_id = ?2 AND ip = ?3)\n OR (expires_at < ?1 AND ip = ?3))\n ORDER BY ip LIMIT 1\n )\n RETURNING ip\n "
},
"ac1e7d2c911b8205f797601c1106d8dd455ad37d7805bb5e708cc389fef971e2": {
"query": "\n UPDATE leases\n SET\n leased = ?4, expires_at = ?5, probation = ?6, client_id = ?7\n WHERE ip in\n (\n SELECT ip\n FROM leases\n WHERE\n ((expires_at > ?1) AND (client_id = ?2) AND (ip = ?3))\n ORDER BY ip LIMIT 1\n )\n RETURNING ip\n ",
"describe": {
"columns": [
{
Expand All @@ -122,16 +187,16 @@
"type_info": "Int64"
}
],
"parameters": {
"Right": 7
},
"nullable": [
false
]
}
],
"parameters": {
"Right": 7
}
},
"query": "\n UPDATE leases\n SET\n leased = ?4, expires_at = ?5, probation = ?6, client_id = ?7\n WHERE ip in\n (\n SELECT ip\n FROM leases\n WHERE\n ((expires_at > ?1) AND (client_id = ?2) AND (ip = ?3))\n ORDER BY ip LIMIT 1\n )\n RETURNING ip\n "
},
"adbd99769bd732ad04fbe219c0b4867094f50d3febba9e8342153afb3f1d0bf7": {
"query": "SELECT * FROM leases WHERE ip = ?1 AND client_id = ?2",
"describe": {
"columns": [
{
Expand Down Expand Up @@ -165,31 +230,31 @@
"type_info": "Bool"
}
],
"parameters": {
"Right": 2
},
"nullable": [
false,
true,
false,
false,
false,
false
]
}
],
"parameters": {
"Right": 2
}
},
"query": "SELECT * FROM leases WHERE ip = ?1 AND client_id = ?2"
},
"aef8d003e1661e7b3ea3a74535cfb94451e91e6a3af65c2fb452cc56a512ac0d": {
"query": "INSERT INTO leases (ip, client_id, expires_at, network) VALUES (?1, ?2, ?3, ?4)",
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Right": 4
},
"nullable": []
}
}
},
"query": "INSERT INTO leases (ip, client_id, expires_at, network) VALUES (?1, ?2, ?3, ?4)"
},
"b2234ad91400eac3cc40103cde969bb8acb66cd866a25515815c187d2b959c52": {
"query": "\n SELECT\n *\n FROM\n leases\n WHERE\n ip >= ?1 AND ip <= ?2\n ORDER BY\n ip DESC\n LIMIT 1\n ",
"describe": {
"columns": [
{
Expand Down Expand Up @@ -223,21 +288,21 @@
"type_info": "Bool"
}
],
"parameters": {
"Right": 2
},
"nullable": [
false,
true,
false,
false,
false,
false
]
}
],
"parameters": {
"Right": 2
}
},
"query": "\n SELECT\n *\n FROM\n leases\n WHERE\n ip >= ?1 AND ip <= ?2\n ORDER BY\n ip DESC\n LIMIT 1\n "
},
"d69709c14c3d5077d08ee45219811df9460eb5ba305097440d953a3c69edcdc0": {
"query": "\n UPDATE leases\n SET\n client_id = ?2, expires_at = ?3, leased = ?4, probation = ?5\n WHERE \n ip = ?1\n RETURNING *\n ",
"b956acaf5fae340ca8d4f050a8d5825fd77dd03d68ccfec6f5c97bc49178bfce": {
"describe": {
"columns": [
{
Expand Down Expand Up @@ -271,45 +336,28 @@
"type_info": "Bool"
}
],
"parameters": {
"Right": 5
},
"nullable": [
false,
true,
false,
false,
false,
false
]
}
],
"parameters": {
"Right": 0
}
},
"query": "SELECT * FROM leases"
},
"d936276b3e7ea7fd4e26597791388e43779d3b87835573709227673ab8d49847": {
"query": "DELETE FROM leases WHERE ip = ?1",
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Right": 1
},
"nullable": []
}
},
"f142683f0ea01af776e17015553be7f6b0b49e030f954bd1a80a38a8de72147d": {
"query": "SELECT ip \n FROM \n leases \n WHERE \n client_id = ?1 AND expires_at > ?2 \n LIMIT 1",
"describe": {
"columns": [
{
"name": "ip",
"ordinal": 0,
"type_info": "Int64"
}
],
"parameters": {
"Right": 2
},
"nullable": [
false
]
}
}
},
"query": "DELETE FROM leases WHERE ip = ?1"
}
}

0 comments on commit dd45079

Please sign in to comment.