done with inventory

This commit is contained in:
2023-08-29 21:34:00 +02:00
parent db4d61570a
commit ef4ef00d2c
15 changed files with 198 additions and 95 deletions

View File

@@ -1,6 +1,6 @@
{
"db_name": "SQLite",
"query": "\n SELECT COALESCE(MAX(i_item.weight), 0) as weight\n FROM inventory_items_categories as category\n INNER JOIN inventory_items as i_item\n ON i_item.category_id = category.id\n WHERE category_id = ?\n ",
"query": "\n SELECT COALESCE(MAX(i_item.weight), 0) as weight\n FROM inventory_items_categories as category\n INNER JOIN inventory_items as i_item\n ON i_item.category_id = category.id\n WHERE \n category_id = ?\n AND category.user_id = ?\n ",
"describe": {
"columns": [
{
@@ -10,11 +10,11 @@
}
],
"parameters": {
"Right": 1
"Right": 2
},
"nullable": [
false
]
},
"hash": "5fd2b986fcaafe93e816f9ed665b6319d120a3987dc5adca1e3c8634203f7533"
"hash": "1899fd9182e8791104be2c369298b3f1731b34404ec5ac3d1312a8d84dbf5c7d"
}

View File

@@ -1,6 +1,6 @@
{
"db_name": "SQLite",
"query": "SELECT\n id,\n name,\n weight,\n description,\n category_id\n FROM inventory_items\n WHERE category_id = ?",
"query": "SELECT\n id,\n name,\n weight,\n description,\n category_id\n FROM inventory_items\n WHERE \n category_id = ?\n AND user_id = ?",
"describe": {
"columns": [
{
@@ -30,7 +30,7 @@
}
],
"parameters": {
"Right": 1
"Right": 2
},
"nullable": [
false,
@@ -40,5 +40,5 @@
false
]
},
"hash": "6973cceeb5499216475136b320b25e1355974e1213829d931abdd6b7a1448a87"
"hash": "2be306559191f0e14e04c33d42b7e5c2aca78e794465ead29273172204534e73"
}

View File

@@ -1,12 +1,12 @@
{
"db_name": "SQLite",
"query": "INSERT INTO inventory_items_categories\n (id, name)\n VALUES\n (?, ?)",
"query": "INSERT INTO inventory_items_categories\n (id, name, user_id)\n VALUES\n (?, ?, ?)",
"describe": {
"columns": [],
"parameters": {
"Right": 2
"Right": 3
},
"nullable": []
},
"hash": "68f936e138283635c5e7bde3313f036aae4167143200ea20fb89e1e99ada9ad1"
"hash": "31bd853345496b0680c337f7b9e3c5e5ee04a315af737507001d9a128e981c52"
}

View File

@@ -1,6 +1,6 @@
{
"db_name": "SQLite",
"query": "SELECT\n id,\n name,\n description\n FROM inventory_items_categories AS category\n WHERE category.id = ?",
"query": "SELECT\n id,\n name,\n description\n FROM inventory_items_categories AS category\n WHERE \n category.id = ?\n AND category.user_id = ?",
"describe": {
"columns": [
{
@@ -20,7 +20,7 @@
}
],
"parameters": {
"Right": 1
"Right": 2
},
"nullable": [
false,
@@ -28,5 +28,5 @@
true
]
},
"hash": "cc1ad49669cff7f89975abfab3d0a8caef2e3978c826e1877db91c05a7f9d00d"
"hash": "4118e44ba436f4ad7de970613fbaa3f88762d37b4e7dbd7b72a76298dad00fd6"
}

View File

@@ -1,12 +0,0 @@
{
"db_name": "SQLite",
"query": "DELETE FROM inventory_items\n WHERE id = ?",
"describe": {
"columns": [],
"parameters": {
"Right": 1
},
"nullable": []
},
"hash": "452cb08b3b46bda9cb62d390d9f518d97626270a26465e55793b0a4b05432e50"
}

View File

@@ -1,6 +1,6 @@
{
"db_name": "SQLite",
"query": "SELECT id,name,description FROM inventory_items_categories",
"query": "SELECT \n id,\n name,\n description \n FROM inventory_items_categories \n WHERE user_id = ?",
"describe": {
"columns": [
{
@@ -20,7 +20,7 @@
}
],
"parameters": {
"Right": 0
"Right": 1
},
"nullable": [
false,
@@ -28,5 +28,5 @@
true
]
},
"hash": "a81bcbeb11260e3b4363e19c26b71b489e326b08bfacb6e11b4c4fc068dc7806"
"hash": "6e8fbd5a7269c6a2021b688b58f74f8235554a414f77af5c2524d51920f0e33c"
}

View File

@@ -1,6 +1,6 @@
{
"db_name": "SQLite",
"query": "\n SELECT COALESCE(SUM(i_item.weight), 0) as weight\n FROM inventory_items_categories as category\n INNER JOIN inventory_items as i_item\n ON i_item.category_id = category.id\n INNER JOIN trips_items as t_item\n ON i_item.id = t_item.item_id\n WHERE category_id = ?\n AND t_item.pick = 1\n ",
"query": "\n SELECT COALESCE(SUM(i_item.weight), 0) as weight\n FROM inventory_items_categories as category\n INNER JOIN inventory_items as i_item\n ON i_item.category_id = category.id\n INNER JOIN trips_items as t_item\n ON i_item.id = t_item.item_id\n WHERE \n category_id = ?\n AND category.user_id = ?\n AND t_item.pick = 1\n ",
"describe": {
"columns": [
{
@@ -10,11 +10,11 @@
}
],
"parameters": {
"Right": 1
"Right": 2
},
"nullable": [
false
]
},
"hash": "f9d080a5b8710c7d6a497bb1f5cf4839ad1589fd7d6a06d3faf1163d6981d8a0"
"hash": "a65f6e3cfb2261d37ce3e806ec8d091314c0b206aee3bfe995d6295f4e0cc911"
}

View File

@@ -1,6 +1,6 @@
{
"db_name": "SQLite",
"query": "SELECT\n item.id AS id,\n item.name AS name,\n item.description AS description,\n weight,\n category.id AS category_id,\n category.name AS category_name,\n category.description AS category_description,\n product.id AS product_id,\n product.name AS product_name,\n product.description AS product_description,\n product.comment AS product_comment\n FROM inventory_items AS item\n INNER JOIN inventory_items_categories as category\n ON item.category_id = category.id\n LEFT JOIN inventory_products AS product\n ON item.product_id = product.id\n WHERE item.id = ?",
"query": "SELECT\n item.id AS id,\n item.name AS name,\n item.description AS description,\n weight,\n category.id AS category_id,\n category.name AS category_name,\n category.description AS category_description,\n product.id AS product_id,\n product.name AS product_name,\n product.description AS product_description,\n product.comment AS product_comment\n FROM inventory_items AS item\n INNER JOIN inventory_items_categories as category\n ON item.category_id = category.id\n LEFT JOIN inventory_products AS product\n ON item.product_id = product.id\n WHERE \n item.id = ?\n AND item.user_id = ?",
"describe": {
"columns": [
{
@@ -60,7 +60,7 @@
}
],
"parameters": {
"Right": 1
"Right": 2
},
"nullable": [
false,
@@ -76,5 +76,5 @@
true
]
},
"hash": "629f34ef9bd0afa39123758cc182468edb7475f6c08cb4b5febb3ce931f2b547"
"hash": "b4d2e5f57ee95dd449ab0d69450d471d9fd80b9fc943436185dcd25c7402271e"
}

View File

@@ -1,6 +1,6 @@
{
"db_name": "SQLite",
"query": "UPDATE inventory_items AS item\n SET\n name = ?,\n weight = ?\n WHERE item.id = ?\n RETURNING inventory_items.category_id AS id\n ",
"query": "UPDATE inventory_items AS item\n SET\n name = ?,\n weight = ?\n WHERE \n item.id = ?\n AND item.user_id = ?\n RETURNING inventory_items.category_id AS id\n ",
"describe": {
"columns": [
{
@@ -10,11 +10,11 @@
}
],
"parameters": {
"Right": 3
"Right": 4
},
"nullable": [
false
]
},
"hash": "0d341935886c28710302aec9d5d085b535ad54949b87793e98cbf3bd5d828a41"
"hash": "c1afeeec7f57f4af47d9a99f807b7be6fe2441af601a77d462a99ca7a22ca7c4"
}

View File

@@ -1,6 +1,6 @@
{
"db_name": "SQLite",
"query": "SELECT id\n FROM inventory_items\n WHERE name = ?",
"query": "SELECT id\n FROM inventory_items\n WHERE \n name = ?\n AND user_id = ?",
"describe": {
"columns": [
{
@@ -10,11 +10,11 @@
}
],
"parameters": {
"Right": 1
"Right": 2
},
"nullable": [
false
]
},
"hash": "918fc9cf50097d4210b212255ef49335ebedbe81002ce9a418b4dab4fbb29aa3"
"hash": "c34c9c567a98937e043424db17246ddf23dbc8b618dca6c637f2d71d03841920"
}

View File

@@ -1,12 +0,0 @@
{
"db_name": "SQLite",
"query": "INSERT INTO inventory_items\n (id, name, description, weight, category_id)\n VALUES\n (?, ?, ?, ?, ?)",
"describe": {
"columns": [],
"parameters": {
"Right": 5
},
"nullable": []
},
"hash": "d7c6ae3c6e00c6c99b0bedee87ff237b01007e7001584c82ae896b91833b807b"
}

View File

@@ -0,0 +1,12 @@
{
"db_name": "SQLite",
"query": "DELETE FROM inventory_items\n WHERE \n id = ?\n AND user_id = ?",
"describe": {
"columns": [],
"parameters": {
"Right": 2
},
"nullable": []
},
"hash": "ec968e7d97f30547cca37cb1834a054e1ba4ea5461e202cf329b929953c00894"
}

View File

@@ -0,0 +1,12 @@
{
"db_name": "SQLite",
"query": "INSERT INTO inventory_items\n (id, name, description, weight, category_id, user_id)\n VALUES\n (?, ?, ?, ?, ?, ?)",
"describe": {
"columns": [],
"parameters": {
"Right": 6
},
"nullable": []
},
"hash": "f6a5ccd2290b8c3d12cddd7c80899b551fa40dbec71f1498974f9a07cdf5f70e"
}