!lNGJpfiFVovXFJYmwx:matrix.org

Diesel

3158 Members
A safe, extensible ORM and Query Builder for Rust79 Servers

Load older messages


SenderMessageTime
18 Apr 2024
@obsoleszenz:gitter.imobsoleszenzhad one conflict in diesel_compile_tests/Cargo.lock, basically the version. So kept it at 2.1.5, i guess you bump that when you cut a release?18:14:21
@weiznich-55bcb4c20fc9f982beabc3ad:gitter.imweiznich
In reply to @obsoleszenz:gitter.im
had one conflict in diesel_compile_tests/Cargo.lock, basically the version. So kept it at 2.1.5, i guess you bump that when you cut a release?
I always forget doing that, but that should not matter.
18:35:35
@weiznich-55bcb4c20fc9f982beabc3ad:gitter.imweiznich Thanks for opening this Pr. 18:35:48
@obsoleszenz:gitter.imobsoleszenzThank you for all your efforts :)18:36:44
19 Apr 2024
@alfaex-5882bad4d73408ce4f44f7f6:gitter.im@alfaex-5882bad4d73408ce4f44f7f6:gitter.im left the room.03:09:48
@silence_zhpf:matrix.orgsilence_zhpf

I define a sql_function in the below code

sql_function!(fn is_enable(state:Nullable<Integer>) -> Nullable<Integer>);

type IsEnable<T> = Eq<is_enable::HelperType<T>, is_enable::HelperType<State>>;

fn is_state_enable<T>(field: T) -> IsEnable<T>
where
    T: diesel::Expression<SqlType = Nullable<Integer>>,
{
    is_enable(field).eq(is_enable(State::Enable))
}

but when I run the code, it said to me Function xxxx.is_enable does not exist

08:17:16
@silence_zhpf:matrix.orgsilence_zhpfWhy?08:17:24
@weiznich-55bcb4c20fc9f982beabc3ad:gitter.imweiznichWell that means that no function with that name exists in your database. Did you define it there?08:18:31
@silence_zhpf:matrix.orgsilence_zhpfIn the database, I didn't define it.08:19:09
@silence_zhpf:matrix.orgsilence_zhpf Do you mean that the method defined in sql_function must have a corresponding definition in the database? 08:21:08
@weiznich-55bcb4c20fc9f982beabc3ad:gitter.imweiznich

Well, then it's not surprising that your database complains that this function is missing. You need to define it there as well.

sql_function! merely defines that the database contains a function with that signature. Everything else needs to be handled by you at database level.

08:21:33
@silence_zhpf:matrix.orgsilence_zhpfOk . I understand it now. Thanks.08:23:35
@silence_zhpf:matrix.orgsilence_zhpf
In reply to @weiznich-55bcb4c20fc9f982beabc3ad:gitter.im
Checkout the composing application guide for how to do that
I tried one of the sql_function methods, but this one doesn't solve my problem, which one should I try with?
08:27:33
@weiznich-55bcb4c20fc9f982beabc3ad:gitter.imweiznichWell, maybe try one of the other variants listed there?08:28:56
@weiznich-55bcb4c20fc9f982beabc3ad:gitter.imweiznich (sql_function! is not the solution to that problem) 08:29:08
@silence_zhpf:matrix.orgsilence_zhpfBut I don't have an idea right now, can you point me in the right direction?08:30:31
@weiznich-55bcb4c20fc9f982beabc3ad:gitter.imweiznichI do not have the capacity to guide you step by step through your problems. I suggest that you really sit down and try to read the guide until the end and try to understand how you can apply that what's shown there to your problem. It's explained quite well there and I fear I cannot explain it better in the limited amount of time I can spend on supporting you here.08:40:27
@silence_zhpf:matrix.orgsilence_zhpfThanks, I'll ask you again if I come across a specific question08:43:03
@ethanhawthorne:gitter.imethanhawthorne joined the room.11:49:32
@ethanhawthorne:gitter.imethanhawthorne Hi, I'm new to diesel and rust and I'm trying to install the diesel cli on my windows 11 machine with just sqllite. When I install it throws the error ""error: linking with x86_64-w64-mingw32-gcc failed: exit code: 1" with the note "note: ld: cannot find -lsqlite3: No such file or directory". I've tried to fix this by making the sqlite3.dll global but I'm still getting the same error. Where do I put the .dll file to let the install compile? 12:29:50
@weiznich-55bcb4c20fc9f982beabc3ad:gitter.imweiznich
In reply to @ethanhawthorne:gitter.im
Hi, I'm new to diesel and rust and I'm trying to install the diesel cli on my windows 11 machine with just sqllite. When I install it throws the error ""error: linking with x86_64-w64-mingw32-gcc failed: exit code: 1" with the note "note: ld: cannot find -lsqlite3: No such file or directory". I've tried to fix this by making the sqlite3.dll global but I'm still getting the same error. Where do I put the .dll file to let the install compile?

For diesel-cli there is a sqlite-bundled feature that just builds libsqlite3 as part of your cargo install command.

For building diesel itself later in your application you might want to add the libsqlite3-sys crate to you dependency list and enable the bundled feature (for libsqlite3-sys) there as well.

12:36:53
@ethanhawthorne:gitter.imethanhawthorneI've implemented those changes, it gave me an error about not having a gcc.exe I installed MinGW64 which has gcc.exe and have globalised it on my system, although this has given another error saying that gcc.exe did not execute successfully? Not sure what where to go from here I'm using VS code. Here's cargo.toml. [package] name = "Password_Manager" version = "0.1.0" edition = "2021" [dependencies] rocket = "0.5.0" simple-log = "1.6.0" log = "=0.4.21" diesel = { version = "2.1.6", features= ["sqlite"]} libsqlite3-sys = {version="0.26.0", features= ["bundled"]} [dependencies.rocket_sync_db_pools] version = "0.1.0" features = ["diesel_sqlite_pool"] 14:10:51
@weiznich-55bcb4c20fc9f982beabc3ad:gitter.imweiznich

It’s hard to help you with that as these kind of errors are caused by your environment configuration. You can try the following things:

  • the msvc rust target
  • compiling your project using sql
  • check in the vs code terminal whether or not you can execute gcc
15:42:37
20 Apr 2024
@ethanhawthorne:gitter.imethanhawthorne could it be something to do with my target when i run gcc -v this is what I get "Using built-in specs. COLLECT_GCC=C:\MinGW\bin\g++.exe COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe Target: mingw32 Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic --enable-libgomp --disable-libvtv --enable-nls Thread model: win32 gcc version 6.3.0 (MinGW.org GCC-6.3.0-1) " Could that be the problem and if so how would I change it? Thanks for the help so far. 16:30:48
21 Apr 2024
@ves:nitro.chatves joined the room.07:35:22
@ves:nitro.chatves left the room.07:36:15
@ves:nitro.chatves joined the room.07:38:09
22 Apr 2024
@silence_zhpf:matrix.orgsilence_zhpf I have a type question about the update sql: how can I define the type of the UpdateStatment, I don't know how to define the WhereClause... 06:11:04
@weiznich-55bcb4c20fc9f982beabc3ad:gitter.imweiznichThat usually means that you cannot define these types as they are considered to be private API.06:12:25
@silence_zhpf:matrix.orgsilence_zhpf

That means I can't define a function to return an UpdateStatement like this ?

        use member_exchange_goods::dsl;
        diesel::update(dsl::member_exchange_goods.filter(dsl::goods_id.eq(id.to_string())))
06:14:28

Show newer messages


Back to Room ListRoom Version: