diff --git a/.sqlx/query-1e49ad572eb24d7ca2ca48ff82625d3ef4fd83f41062f1ffb83daf55d84b7ce8.json b/.sqlx/query-1e49ad572eb24d7ca2ca48ff82625d3ef4fd83f41062f1ffb83daf55d84b7ce8.json new file mode 100644 index 0000000..f7957d2 --- /dev/null +++ b/.sqlx/query-1e49ad572eb24d7ca2ca48ff82625d3ef4fd83f41062f1ffb83daf55d84b7ce8.json @@ -0,0 +1,133 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id as \"id!\", lcsc as \"lcsc!\", category_id as \"category_id!\", mfr as \"mfr?\", package as \"package?\", joints as \"joints!\", manufacturer as \"manufacturer!\", basic as \"basic!\", description as \"description?\", datasheet as \"datasheet?\", stock as \"stock!\", price as \"price?\", last_update as \"last_update!\", resistance as \"resistance?\", inductance, capacitance, dielectric as \"dielectric?\", current, voltage FROM parts WHERE category_id = $1 and resistance between $2 and $3 and package = $4 ORDER BY basic DESC LIMIT 100", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id!", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "lcsc!", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "category_id!", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "mfr?", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "package?", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "joints!", + "type_info": "Int4" + }, + { + "ordinal": 6, + "name": "manufacturer!", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "basic!", + "type_info": "Bool" + }, + { + "ordinal": 8, + "name": "description?", + "type_info": "Varchar" + }, + { + "ordinal": 9, + "name": "datasheet?", + "type_info": "Varchar" + }, + { + "ordinal": 10, + "name": "stock!", + "type_info": "Int4" + }, + { + "ordinal": 11, + "name": "price?", + "type_info": "Float8" + }, + { + "ordinal": 12, + "name": "last_update!", + "type_info": "Timestamp" + }, + { + "ordinal": 13, + "name": "resistance?", + "type_info": "Float8" + }, + { + "ordinal": 14, + "name": "inductance", + "type_info": "Float8" + }, + { + "ordinal": 15, + "name": "capacitance", + "type_info": "Float8" + }, + { + "ordinal": 16, + "name": "dielectric?", + "type_info": "Varchar" + }, + { + "ordinal": 17, + "name": "current", + "type_info": "Float8" + }, + { + "ordinal": 18, + "name": "voltage", + "type_info": "Float8" + } + ], + "parameters": { + "Left": [ + "Int4", + "Float8", + "Float8", + "Text" + ] + }, + "nullable": [ + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ] + }, + "hash": "1e49ad572eb24d7ca2ca48ff82625d3ef4fd83f41062f1ffb83daf55d84b7ce8" +} diff --git a/.sqlx/query-78fcc090ffc4d3bd62af783ceee202731a6daeaa6efc9f1334bf80e562c1c6d0.json b/.sqlx/query-78fcc090ffc4d3bd62af783ceee202731a6daeaa6efc9f1334bf80e562c1c6d0.json new file mode 100644 index 0000000..dfc41dc --- /dev/null +++ b/.sqlx/query-78fcc090ffc4d3bd62af783ceee202731a6daeaa6efc9f1334bf80e562c1c6d0.json @@ -0,0 +1,132 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id as \"id!\", lcsc as \"lcsc!\", category_id as \"category_id!\", mfr as \"mfr?\", package as \"package?\", joints as \"joints!\", manufacturer as \"manufacturer!\", basic as \"basic!\", description as \"description?\", datasheet as \"datasheet?\", stock as \"stock!\", price as \"price?\", last_update as \"last_update!\", inductance as \"inductance?\", capacitance, resistance, dielectric as \"dielectric?\", current, voltage FROM parts WHERE category_id = $1 and inductance between $2 and $3 ORDER BY basic DESC LIMIT 100", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id!", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "lcsc!", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "category_id!", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "mfr?", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "package?", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "joints!", + "type_info": "Int4" + }, + { + "ordinal": 6, + "name": "manufacturer!", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "basic!", + "type_info": "Bool" + }, + { + "ordinal": 8, + "name": "description?", + "type_info": "Varchar" + }, + { + "ordinal": 9, + "name": "datasheet?", + "type_info": "Varchar" + }, + { + "ordinal": 10, + "name": "stock!", + "type_info": "Int4" + }, + { + "ordinal": 11, + "name": "price?", + "type_info": "Float8" + }, + { + "ordinal": 12, + "name": "last_update!", + "type_info": "Timestamp" + }, + { + "ordinal": 13, + "name": "inductance?", + "type_info": "Float8" + }, + { + "ordinal": 14, + "name": "capacitance", + "type_info": "Float8" + }, + { + "ordinal": 15, + "name": "resistance", + "type_info": "Float8" + }, + { + "ordinal": 16, + "name": "dielectric?", + "type_info": "Varchar" + }, + { + "ordinal": 17, + "name": "current", + "type_info": "Float8" + }, + { + "ordinal": 18, + "name": "voltage", + "type_info": "Float8" + } + ], + "parameters": { + "Left": [ + "Int4", + "Float8", + "Float8" + ] + }, + "nullable": [ + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ] + }, + "hash": "78fcc090ffc4d3bd62af783ceee202731a6daeaa6efc9f1334bf80e562c1c6d0" +} diff --git a/.sqlx/query-8c0ea99f878cea13e715876360c34a7d98576e78979e7a8115a836d4e0947e1c.json b/.sqlx/query-8c0ea99f878cea13e715876360c34a7d98576e78979e7a8115a836d4e0947e1c.json new file mode 100644 index 0000000..40e8a7d --- /dev/null +++ b/.sqlx/query-8c0ea99f878cea13e715876360c34a7d98576e78979e7a8115a836d4e0947e1c.json @@ -0,0 +1,132 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id as \"id!\", lcsc as \"lcsc!\", category_id as \"category_id!\", mfr as \"mfr?\", package as \"package?\", joints as \"joints!\", manufacturer as \"manufacturer!\", basic as \"basic!\", description as \"description?\", datasheet as \"datasheet?\", stock as \"stock!\", price as \"price?\", last_update as \"last_update!\", capacitance as \"capacitance?\", inductance, resistance, dielectric as \"dielectric?\", current, voltage FROM parts WHERE category_id = $1 and capacitance between $2 and $3 ORDER BY basic DESC LIMIT 100", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id!", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "lcsc!", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "category_id!", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "mfr?", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "package?", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "joints!", + "type_info": "Int4" + }, + { + "ordinal": 6, + "name": "manufacturer!", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "basic!", + "type_info": "Bool" + }, + { + "ordinal": 8, + "name": "description?", + "type_info": "Varchar" + }, + { + "ordinal": 9, + "name": "datasheet?", + "type_info": "Varchar" + }, + { + "ordinal": 10, + "name": "stock!", + "type_info": "Int4" + }, + { + "ordinal": 11, + "name": "price?", + "type_info": "Float8" + }, + { + "ordinal": 12, + "name": "last_update!", + "type_info": "Timestamp" + }, + { + "ordinal": 13, + "name": "capacitance?", + "type_info": "Float8" + }, + { + "ordinal": 14, + "name": "inductance", + "type_info": "Float8" + }, + { + "ordinal": 15, + "name": "resistance", + "type_info": "Float8" + }, + { + "ordinal": 16, + "name": "dielectric?", + "type_info": "Varchar" + }, + { + "ordinal": 17, + "name": "current", + "type_info": "Float8" + }, + { + "ordinal": 18, + "name": "voltage", + "type_info": "Float8" + } + ], + "parameters": { + "Left": [ + "Int4", + "Float8", + "Float8" + ] + }, + "nullable": [ + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ] + }, + "hash": "8c0ea99f878cea13e715876360c34a7d98576e78979e7a8115a836d4e0947e1c" +} diff --git a/.sqlx/query-8dd7272c4c2f5bc87acf5dbd4e8b0c78cd4f9973e57eb471eaf3703cf9d15dd3.json b/.sqlx/query-8dd7272c4c2f5bc87acf5dbd4e8b0c78cd4f9973e57eb471eaf3703cf9d15dd3.json new file mode 100644 index 0000000..5b7dafc --- /dev/null +++ b/.sqlx/query-8dd7272c4c2f5bc87acf5dbd4e8b0c78cd4f9973e57eb471eaf3703cf9d15dd3.json @@ -0,0 +1,133 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id as \"id!\", lcsc as \"lcsc!\", category_id as \"category_id!\", mfr as \"mfr?\", package as \"package?\", joints as \"joints!\", manufacturer as \"manufacturer!\", basic as \"basic!\", description as \"description?\", datasheet as \"datasheet?\", stock as \"stock!\", price as \"price?\", last_update as \"last_update!\", inductance as \"inductance?\", capacitance, resistance, dielectric as \"dielectric?\", current, voltage FROM parts WHERE category_id = $1 and inductance between $2 and $3 and package = $4 ORDER BY basic DESC LIMIT 100", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id!", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "lcsc!", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "category_id!", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "mfr?", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "package?", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "joints!", + "type_info": "Int4" + }, + { + "ordinal": 6, + "name": "manufacturer!", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "basic!", + "type_info": "Bool" + }, + { + "ordinal": 8, + "name": "description?", + "type_info": "Varchar" + }, + { + "ordinal": 9, + "name": "datasheet?", + "type_info": "Varchar" + }, + { + "ordinal": 10, + "name": "stock!", + "type_info": "Int4" + }, + { + "ordinal": 11, + "name": "price?", + "type_info": "Float8" + }, + { + "ordinal": 12, + "name": "last_update!", + "type_info": "Timestamp" + }, + { + "ordinal": 13, + "name": "inductance?", + "type_info": "Float8" + }, + { + "ordinal": 14, + "name": "capacitance", + "type_info": "Float8" + }, + { + "ordinal": 15, + "name": "resistance", + "type_info": "Float8" + }, + { + "ordinal": 16, + "name": "dielectric?", + "type_info": "Varchar" + }, + { + "ordinal": 17, + "name": "current", + "type_info": "Float8" + }, + { + "ordinal": 18, + "name": "voltage", + "type_info": "Float8" + } + ], + "parameters": { + "Left": [ + "Int4", + "Float8", + "Float8", + "Text" + ] + }, + "nullable": [ + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ] + }, + "hash": "8dd7272c4c2f5bc87acf5dbd4e8b0c78cd4f9973e57eb471eaf3703cf9d15dd3" +} diff --git a/.sqlx/query-9cf7dc345d643d9ae0cd8b15534a4f9369c974ab0072aeb736773d664c36a92f.json b/.sqlx/query-9cf7dc345d643d9ae0cd8b15534a4f9369c974ab0072aeb736773d664c36a92f.json new file mode 100644 index 0000000..e1f6e0c --- /dev/null +++ b/.sqlx/query-9cf7dc345d643d9ae0cd8b15534a4f9369c974ab0072aeb736773d664c36a92f.json @@ -0,0 +1,133 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id as \"id!\", lcsc as \"lcsc!\", category_id as \"category_id!\", mfr as \"mfr?\", package as \"package?\", joints as \"joints!\", manufacturer as \"manufacturer!\", basic as \"basic!\", description as \"description?\", datasheet as \"datasheet?\", stock as \"stock!\", price as \"price?\", last_update as \"last_update!\", capacitance as \"capacitance?\", inductance, resistance, dielectric as \"dielectric?\", current, voltage FROM parts WHERE category_id = $1 and capacitance between $2 and $3 and package = $4 ORDER BY basic DESC LIMIT 100", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id!", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "lcsc!", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "category_id!", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "mfr?", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "package?", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "joints!", + "type_info": "Int4" + }, + { + "ordinal": 6, + "name": "manufacturer!", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "basic!", + "type_info": "Bool" + }, + { + "ordinal": 8, + "name": "description?", + "type_info": "Varchar" + }, + { + "ordinal": 9, + "name": "datasheet?", + "type_info": "Varchar" + }, + { + "ordinal": 10, + "name": "stock!", + "type_info": "Int4" + }, + { + "ordinal": 11, + "name": "price?", + "type_info": "Float8" + }, + { + "ordinal": 12, + "name": "last_update!", + "type_info": "Timestamp" + }, + { + "ordinal": 13, + "name": "capacitance?", + "type_info": "Float8" + }, + { + "ordinal": 14, + "name": "inductance", + "type_info": "Float8" + }, + { + "ordinal": 15, + "name": "resistance", + "type_info": "Float8" + }, + { + "ordinal": 16, + "name": "dielectric?", + "type_info": "Varchar" + }, + { + "ordinal": 17, + "name": "current", + "type_info": "Float8" + }, + { + "ordinal": 18, + "name": "voltage", + "type_info": "Float8" + } + ], + "parameters": { + "Left": [ + "Int4", + "Float8", + "Float8", + "Text" + ] + }, + "nullable": [ + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ] + }, + "hash": "9cf7dc345d643d9ae0cd8b15534a4f9369c974ab0072aeb736773d664c36a92f" +} diff --git a/.sqlx/query-9db320d5201b361660dca48511c49ebfea3c28b3ddf181dbf6e1d80854d88efa.json b/.sqlx/query-9db320d5201b361660dca48511c49ebfea3c28b3ddf181dbf6e1d80854d88efa.json new file mode 100644 index 0000000..e36b2f2 --- /dev/null +++ b/.sqlx/query-9db320d5201b361660dca48511c49ebfea3c28b3ddf181dbf6e1d80854d88efa.json @@ -0,0 +1,132 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id as \"id!\", lcsc as \"lcsc!\", category_id as \"category_id!\", mfr as \"mfr?\", package as \"package?\", joints as \"joints!\", manufacturer as \"manufacturer!\", basic as \"basic!\", description as \"description?\", datasheet as \"datasheet?\", stock as \"stock!\", price as \"price?\", last_update as \"last_update!\", resistance as \"resistance?\", inductance, capacitance, dielectric as \"dielectric?\", current, voltage FROM parts WHERE category_id = $1 and resistance between $2 and $3 ORDER BY basic DESC LIMIT 100", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id!", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "lcsc!", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "category_id!", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "mfr?", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "package?", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "joints!", + "type_info": "Int4" + }, + { + "ordinal": 6, + "name": "manufacturer!", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "basic!", + "type_info": "Bool" + }, + { + "ordinal": 8, + "name": "description?", + "type_info": "Varchar" + }, + { + "ordinal": 9, + "name": "datasheet?", + "type_info": "Varchar" + }, + { + "ordinal": 10, + "name": "stock!", + "type_info": "Int4" + }, + { + "ordinal": 11, + "name": "price?", + "type_info": "Float8" + }, + { + "ordinal": 12, + "name": "last_update!", + "type_info": "Timestamp" + }, + { + "ordinal": 13, + "name": "resistance?", + "type_info": "Float8" + }, + { + "ordinal": 14, + "name": "inductance", + "type_info": "Float8" + }, + { + "ordinal": 15, + "name": "capacitance", + "type_info": "Float8" + }, + { + "ordinal": 16, + "name": "dielectric?", + "type_info": "Varchar" + }, + { + "ordinal": 17, + "name": "current", + "type_info": "Float8" + }, + { + "ordinal": 18, + "name": "voltage", + "type_info": "Float8" + } + ], + "parameters": { + "Left": [ + "Int4", + "Float8", + "Float8" + ] + }, + "nullable": [ + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ] + }, + "hash": "9db320d5201b361660dca48511c49ebfea3c28b3ddf181dbf6e1d80854d88efa" +} diff --git a/Cargo.lock b/Cargo.lock index 11b1d62..93ced20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -207,7 +207,7 @@ dependencies = [ [[package]] name = "atopile-jlc-parts" -version = "0.3.0" +version = "0.3.1" dependencies = [ "axum", "clap 4.5.1", diff --git a/Cargo.toml b/Cargo.toml index 0e94705..8144d6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atopile-jlc-parts" -version = "0.3.0" +version = "0.3.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/Dockerfile.dev b/Dockerfile.dev index 39cc673..f2ef796 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -6,4 +6,5 @@ FROM rust:slim-${VARIANT} RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends libpq-dev pkg-config git mold p7zip-full RUN cargo install cargo-watch +RUN cargo install sqlx-cli RUN rustup component add rustfmt \ No newline at end of file