Skip to main content

Questions tagged [rust-diesel]

This tag should be used for questions related to the diesel Rust ORM.

0 votes
0 answers
31 views

required for `&str` to implement `ToSql<diesel::sql_types::Array<diesel::sql_types::Text>, Pg>`

I'm trying to build a Diesel query that will make the search Postgres field defined as a varchar array similar to this SELECT value FROM table WHERE ANY VALUE IN array_column = 'Carol'; But this ...
andrey.shedko's user avatar
-1 votes
0 answers
36 views

POST handler doesnt get invoked when a POST request is sent

new to Rust, Actix and Diesel. I have been trying to implement a basic route and corresponding handlers to search, insert, delete users from table in Postgre. The GET requests works Ok and ...
RamP's user avatar
  • 1
0 votes
0 answers
38 views

Debian docker Error: libpq.so.5: cannot open shared object file: No such file or directory

I am using docker to build a diesel rust application, For ease of deployment i am using the below DockerFile to create the image, but when i try to run it , it gives the error /app/rest-jwt-rust: ...
Emmanuel Thomas's user avatar
-3 votes
0 answers
30 views

Is there a better schema I could choose for simple personal finance program? [closed]

I don't have a lot of practical experience with databases, and as a vehicle for exploring ORM, I'm writing a personal finance and budgeting program to manage credit card balances. My bank provides a ...
Jamie's user avatar
  • 7,283
0 votes
1 answer
30 views

Probems to translate postgres query to Diesel with NOT IN

I have two tables, achievements, and user_achievements. The structure is similar to the following one: achievements -------------- | id | name | | 1 | one | | 2 | two | | 3 | three | ----------...
Manuelarte's user avatar
  • 1,768
0 votes
1 answer
53 views

On conflict do nothing returns created or previous record

Imagine that I have the following table: CREATE TABLE users ( id SERIAL PRIMARY KEY, created_at TIMESTAMP NOT NULL DEFAULT NOW(), updated_at TIMESTAMP NOT NULL DEFAULT NOW(), name VARCHAR NOT ...
Manuelarte's user avatar
  • 1,768
0 votes
0 answers
36 views

Can a LEFT JOIN in Diesel use default values instead of `Option`?

I have two tables that I want to retrieve values from using a LEFT JOIN. Diesel wants to handle any values from the joined table as nullable (which is sensible, given that there may or may not be a ...
Luke Sneeringer's user avatar
2 votes
0 answers
40 views

Dockerized rust program only connects to other containers via "host" networking

I'm working on a project where my Rust application is containerized using Docker. I've encountered an issue where the Rust program can only connect to the PostgreSQL database when the container is run ...
Jens Lundt's user avatar
0 votes
1 answer
42 views

Diesel Migrations: Solution for table creation & column addition?

I'm working on a Diesel project and want to streamline my migrations. Ideally, I'd like a single up.sql file that can handle both creating the table and adding new columns later. Is there a ...
John Philip's user avatar
0 votes
1 answer
75 views

Is there a better way of querying foreign key relationships in rust-diesel?

I’m learning rust to move from django. Using diesel ORM i have a model consisting of users, posts (with a foreign key to user), and likes (with foreign keys to user and post). This query is to ...
Awm's user avatar
  • 11
0 votes
1 answer
41 views

How to check if value in colum exists using Diesel?

I've been looking for a way to check for a value in my database for a few days now, but I'm running into various problems. src/schema.rs diesel::table! { qrcode (id) { id -> Int4, ...
Yuniversia's user avatar
-1 votes
1 answer
257 views

How can I connect to a MariaDB database in Rust (on W10)?

Diesel seems to be a popular crate for database connections. So that's what I tried first. But the question is (now) accurately expressed: I am interested in any way of connecting between Rust and ...
mike rodent's user avatar
  • 15.1k
0 votes
0 answers
57 views

Cant connect to the psotgresql database using diesel-cli

I have a postgres database running on my computer and i have set the DATABASE_URL environment variable but when i try to setup my diesel ORM for my project i get this error connection to server at &...
Sarang Dutta's user avatar
0 votes
1 answer
92 views

How to define a Queryable and Insertable struct with AUTO_INCREMENT column using Diesel ORM in Rust?

I am struggling with a seemingly basic task with Diesel ORM. I am trying to define a struct that I can both insert (without specifying id manually) and query, for a simple table. CREATE TABLE users( ...
goose_lake's user avatar
  • 1,272
1 vote
0 answers
28 views

Is it necessary to create duplicate type definitions for data when using Diesel ORM in Rust? [duplicate]

I am starting to use the Diesel ORM for an application, and am confused about the necessary steps described in the official getting started guide. It seems like the ORM first requires to create type ...
goose_lake's user avatar
  • 1,272

15 30 50 per page
1
2 3 4 5
29