This commit is contained in:
2024-04-30 09:04:40 +02:00
parent cd25631863
commit d08c41e809
6 changed files with 29 additions and 29 deletions

View File

@@ -1,6 +1,6 @@
[target.x86_64-unknown-linux-gnu] [target.x86_64-unknown-linux-gnu]
rustflags = [ rustflags = [
"--codegen", "linker=clang", "--codegen", "linker=clang",
"--codegen", "link-arg=--ld-path=/usr/bin/mold", "--codegen", "link-arg=--ld-path=/usr/bin/mold",
"--cfg", "tokio_unstable" "--cfg", "tokio_unstable"
] ]

View File

@@ -162,7 +162,7 @@ impl crud::Read for Todo {
FROM trip_todos AS todo FROM trip_todos AS todo
INNER JOIN trips INNER JOIN trips
ON trips.id = todo.trip_id ON trips.id = todo.trip_id
WHERE WHERE
trips.id = $1 trips.id = $1
AND trips.user_id = $2 AND trips.user_id = $2
"#, "#,
@@ -199,7 +199,7 @@ impl crud::Read for Todo {
FROM trip_todos AS todo FROM trip_todos AS todo
INNER JOIN trips INNER JOIN trips
ON trips.id = todo.trip_id ON trips.id = todo.trip_id
WHERE WHERE
trips.id = $1 trips.id = $1
AND todo.id = $2 AND todo.id = $2
AND trips.user_id = $3 AND trips.user_id = $3
@@ -361,8 +361,8 @@ impl crud::Update for Todo {
r#" r#"
UPDATE trip_todos UPDATE trip_todos
SET description = ? SET description = ?
WHERE WHERE
id = ? id = ?
AND trip_id = ? AND trip_id = ?
AND EXISTS(SELECT 1 FROM trips WHERE trip_id = ? AND user_id = ?) AND EXISTS(SELECT 1 FROM trips WHERE trip_id = ? AND user_id = ?)
RETURNING RETURNING

View File

@@ -23,8 +23,8 @@ impl Inventory {
"SELECT "SELECT
id, id,
name, name,
description description
FROM inventory_items_categories FROM inventory_items_categories
WHERE user_id = ?", WHERE user_id = ?",
user_id user_id
) )
@@ -87,7 +87,7 @@ impl Category {
name, name,
description description
FROM inventory_items_categories AS category FROM inventory_items_categories AS category
WHERE WHERE
category.id = ? category.id = ?
AND category.user_id = ?", AND category.user_id = ?",
id_param, id_param,
@@ -155,7 +155,7 @@ impl Category {
description, description,
category_id category_id
FROM inventory_items FROM inventory_items
WHERE WHERE
category_id = ? category_id = ?
AND user_id = ?", AND user_id = ?",
id, id,
@@ -261,7 +261,7 @@ impl InventoryItem {
ON item.category_id = category.id ON item.category_id = category.id
LEFT JOIN inventory_products AS product LEFT JOIN inventory_products AS product
ON item.product_id = product.id ON item.product_id = product.id
WHERE WHERE
item.id = ? item.id = ?
AND item.user_id = ?", AND item.user_id = ?",
id_param, id_param,
@@ -285,7 +285,7 @@ impl InventoryItem {
pool, pool,
"SELECT id "SELECT id
FROM inventory_items FROM inventory_items
WHERE WHERE
name = ? name = ?
AND user_id = ?", AND user_id = ?",
name, name,
@@ -305,7 +305,7 @@ impl InventoryItem {
}, },
pool, pool,
"DELETE FROM inventory_items "DELETE FROM inventory_items
WHERE WHERE
id = ? id = ?
AND user_id = ?", AND user_id = ?",
id_param, id_param,
@@ -338,7 +338,7 @@ impl InventoryItem {
SET SET
name = ?, name = ?,
weight = ? weight = ?
WHERE WHERE
item.id = ? item.id = ?
AND item.user_id = ? AND item.user_id = ?
RETURNING inventory_items.category_id AS id RETURNING inventory_items.category_id AS id
@@ -405,7 +405,7 @@ impl InventoryItem {
FROM inventory_items_categories as category FROM inventory_items_categories as category
INNER JOIN inventory_items as i_item INNER JOIN inventory_items as i_item
ON i_item.category_id = category.id ON i_item.category_id = category.id
WHERE WHERE
category_id = ? category_id = ?
AND category.user_id = ? AND category.user_id = ?
", ",
@@ -473,7 +473,7 @@ impl Item {
ON i_item.category_id = category.id ON i_item.category_id = category.id
INNER JOIN trips_items as t_item INNER JOIN trips_items as t_item
ON i_item.id = t_item.item_id ON i_item.id = t_item.item_id
WHERE WHERE
category_id = ? category_id = ?
AND category.user_id = ? AND category.user_id = ?
AND t_item.pick = 1 AND t_item.pick = 1

View File

@@ -263,7 +263,7 @@ impl TripCategory {
ON item.id = trip.item_id ON item.id = trip.item_id
INNER JOIN inventory_items_categories as category INNER JOIN inventory_items_categories as category
ON category.id = item.category_id ON category.id = item.category_id
WHERE WHERE
trip.trip_id = ? trip.trip_id = ?
AND trip.user_id = ? AND trip.user_id = ?
) AS inner ) AS inner
@@ -888,14 +888,14 @@ impl Trip {
}, },
&mut *transaction, &mut *transaction,
r#"INSERT INTO trips_items ( r#"INSERT INTO trips_items (
item_id, item_id,
trip_id, trip_id,
pick, pick,
pack, pack,
ready, ready,
new, new,
user_id user_id
) SELECT ) SELECT
item_id, item_id,
$1 as trip_id, $1 as trip_id,
pick, pick,
@@ -918,14 +918,14 @@ impl Trip {
}, },
&mut *transaction, &mut *transaction,
r#"INSERT INTO trips_items ( r#"INSERT INTO trips_items (
item_id, item_id,
trip_id, trip_id,
pick, pick,
pack, pack,
ready, ready,
new, new,
user_id user_id
) SELECT ) SELECT
id as item_id, id as item_id,
$1 as trip_id, $1 as trip_id,
false as pick, false as pick,

View File

@@ -2,4 +2,4 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
docker run --add-host host.docker.internal:host-gateway --rm --name packager-prometheus -p 9090:9090 -v $SCRIPT_DIR/prometheus.yml:/etc/prometheus/prometheus.yml docker.io/prom/prometheus "${@}" docker run --add-host host.docker.internal:host-gateway --rm --name packager-prometheus -p 9090:9090 -v $SCRIPT_DIR/prometheus.yml:/etc/prometheus/prometheus.yml docker.io/prom/prometheus "${@}"

View File

@@ -5,7 +5,7 @@ set -o pipefail
set -o errexit set -o errexit
id=$(pwgen -s 25 1) id=$(pwgen -s 25 1)
url=registry.hkoerber.de/packager:$id url=registry.hkoerber.de/packager:$id
echo "NEW URL: " $url echo "NEW URL: " $url