Sender | Message | Time |
---|---|---|
22 Apr 2024 | ||
silence_zhpf | * That means I can't define a function to return an
| 06:14:51 |
weiznich | Yes that's not supported yet. | 06:15:16 |
weiznich | (At least as long as there is no type(-def) for this in the public API) | 06:15:43 |
silence_zhpf | So I can't reuse the update fragment like query fragment , that's right? | 06:18:51 |
weiznich | I cannot give you a straight forward answer about that. It might be possible or it might be not possible. I would need to sitdown and read the documentation and try a few things but I don't have the capacity to do that anytime soon. That means you are on your own there. | 06:22:15 |
silence_zhpf | Maybe I can use the Update helper_types, but I didn't know how, maybe I will solve it by myself in future. But anyway, thanks. | 06:27:47 |
weiznich | That doesn't help as you don't call Essentially you could define your own type alias without the changes like that:
and then just use the type of the expression that you passed to | 06:37:53 |
weiznich | I fear I cannot really help you there. I don't use windows for development purposes, but what I know is that the -msvc target is preferred there and the -gnu target is sometimes hard to use. So you really might want to consider using the other target. | 07:16:46 |
maksextraidiot | In reply to @weiznich-55bcb4c20fc9f982beabc3ad:gitter.imAre there some plans about adding it? | 15:34:08 |
weiznich | There are no specific plans from my side to implement that anytime soon as that’s not a feature I personally needed in the past. That written: we are often open to accept DSL extensions as PR if they represent commonly used syntax (part of the sql standard) and they are covered with tests and documentation. | 16:04:20 |
23 Apr 2024 | ||
dlk9999 joined the room. | 22:58:34 | |
dlk9999 | Brand newbie here. I have (seemingly successfully) intalled diesel_cli in my Linux system, but my terminal does not seem to find the diesel command. Any ideas welcome. | 23:00:15 |
24 Apr 2024 | ||
oeed (Oliver Cooper) | Json deserialized values that implement For example:
After some type tracking I discovered it's because
| 00:58:02 |
weiznich | That sounds like the target directory for cargo install is not part of your PATH environment variable. You might need to add it. (Given that we don't know how you installed rust, it's hard to say which directory needs to be added). | 05:31:17 |
weiznich | Seems like you missed to derive #[derive(FromSqlRow)] for your MyJsonValue type. That is required for loading values from the database. | 05:31:57 |
oeed (Oliver Cooper) | Ah nice thank you, didn't realise that was required | 07:15:22 |
weiznich | Do you have suggestions how to make that more clear. The documentation of
| 07:18:36 |
silence_zhpf | I have a question about the into_boxed : the result of into_boxed didn't imply the Clone trait? | 08:03:01 |
weiznich | No that's not supported as trait objects cannot be clone. | 08:07:55 |
silence_zhpf | thanks... | 08:13:25 |
Kartik Soneji joined the room. | 10:15:25 | |
Diana Alazzam | Hello I'm trying to order results from my query according to a search keyword position in the item name or description. From what I understand, INSTR() is not provided by diesel, so I think I need to use raw sql. This might be dumb question, but is there a way to use raw sql for parts of the query? because I have already wrote another filter logic for the same function and I don't want to change everything just for this search thing. Any thoughts? | 12:49:45 |
silence_zhpf | How can I define a type this code
| 13:01:42 |
weiznich | I don't think we provide support for describing the return type of a numeric operation yet. PR's for that are welcome. | 13:07:08 |
weiznich | You might want to use diesel::dsl::sql for that or you might be able to define the DSL for your function via diesel::sql_function! | 13:07:45 |
Kartik Soneji | Hi, I'm using diesel 1.4.8 with postgres on MSVC nightly-2024-02-04, and the program seems to be crashing when a diesel model is returned from a function with (exit code: 0xc0000374, STATUS_HEAP_CORRUPTION) .Interestingly, this doesn't happen if I use a local instance instead of a remote one. | 14:18:10 |
Kartik Soneji | I'm not very well versed with rust, and am a bit unsure how to begin to debug this. | 14:18:35 |
weiznich | Do you use an ssl connection for the remote instance? There was a libpq bug in versions prior to 16.2 to might cause issues with newer OpenSSL versions. That written: diesel 1.4.8 is out of support for some years now. It might also be that updating to 2.1 will fix the problem. (Although that will likely require quite a few code changes) | 14:36:31 |
Diana Alazzam | Thanks | 14:40:07 |
Kartik Soneji | Interesting, but why would an OpenSSL bug cause the crash only when models are returned from a function? Printing the response shows the query does work. | 14:50:50 |