<< 07-01-2024 >>

00:06:29*mengu1 joined #nim
00:35:19*deadmarshal_ quit (Ping timeout: 246 seconds)
00:45:08*mengu1 quit (Quit: Client closed)
00:50:14*deadmarshal_ joined #nim
01:00:03*nazgulsenpai quit (Quit: ZNC 1.8.2 - https://znc.in)
01:04:02*nazgulsenpai joined #nim
03:18:43FromDiscord<nasuray> In reply to @heysokam "iis that possible?": Should be no different than running it with tsx it's just looking for the class names in the file when you run the postcss cleanup (though if you use UnoCSS there is no need for this step as it only generates css for what you actually use)
03:41:26FromDiscord<drunkenalcoholic> Noob question, butr is there away to loop through 33..47 AND 58..64 in the same loop with out including 48..57? https://media.discordapp.net/attachments/371759389889003532/1193398963391438899/image.png?ex=65ac9265&is=659a1d65&hm=2c1a4bd16713cfd68767b81498a336d92d5bba38da6a7223eab8261e67eea50f&
03:47:10FromDiscord<Elegantbeef> Nope make your own iterator
03:47:43*azimut quit (Ping timeout: 240 seconds)
03:47:55FromDiscord<Elegantbeef> https://github.com/beef331/nimtrest/wiki/Code-snippets#iterate-a-group-of-iterables-together
03:47:58FromDiscord<Elegantbeef> Or make a macro
03:54:30FromDiscord<drunkenalcoholic> @ElegantBeef Thanks you, that macro is exactly what I wanted. thanks again
04:18:19*deadmarshal_ quit (Ping timeout: 255 seconds)
04:45:22*nazgulsenpai quit (Ping timeout: 276 seconds)
04:46:32*nazgulsenpai joined #nim
04:57:03*deadmarshal_ joined #nim
05:07:17*deadmarshal_ quit (Ping timeout: 240 seconds)
05:59:50*deadmarshal_ joined #nim
06:25:17*xet7 quit (Quit: Leaving)
06:26:15FromDiscord<pk.kyle> sent a code paste, see https://play.nim-lang.org/#ix=html>
06:29:44*xet7 joined #nim
06:33:42FromDiscord<Phil> Other than a macro I don't think so
06:34:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
06:34:30FromDiscord<Elegantbeef> Or use an array
06:35:58FromDiscord<Phil> ... am I being silly? Shouldn't a threading/channel block if one thread is doing recv on it and the other tries to send?↵Because it only has one lock for both producers and consumers, right? So if a consumer holds the lock to read the next message... doesn't that block the sender out from putting stuff in?
06:36:46FromDiscord<Phil> I'm looking at channelSend and it definitely acquires the lock and then does not release it until sth was sent
06:37:35FromDiscord<Phil> Same with channelReceive, that thing acquires the lock and then blocks until it gets sth. Which categorically I'm not sure it can given that it kinda has the lock
06:38:46FromDiscord<Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html>
06:40:37FromDiscord<pk.kyle> sent a code paste, see https://play.nim-lang.org/#ix=html>
06:43:22FromDiscord<Phil (he/him)> Did a slight correction as this was still showing my prior experiment with Channel, but with Chan it also does not deadlock
06:43:51FromDiscord<Elegantbeef> Looking at the source at least on a first glance you seem to be right
06:44:11FromDiscord<Phil (he/him)> I'm currently trying to wrap my head around waitgroups because that's the only thing I can imagine changing things somehow
06:44:36*xet7 quit (Remote host closed the connection)
06:45:04NimEventerNew thread by aiac: Fixme: the proc parameters always use Copy by default? , see https://forum.nim-lang.org/t/10856
06:49:11FromDiscord<Phil> The heck is a SysCond
06:49:29FromDiscord<Elegantbeef> A condition variable that is abstracted for Unix and Windows
06:49:42*xet7 joined #nim
06:50:09*xet7 quit (Remote host closed the connection)
06:50:09FromDiscord<Elegantbeef> https://linux.die.net/man/3/pthread_cond_wait
06:51:13*xet7 joined #nim
06:51:23FromDiscord<Phil> So a thing different per OS and unified for simplification purposes.↵Now what a condition variable is I don't understand the specifications off.↵Like is that just a boolean variable? Does it have defined implications?
06:52:12FromDiscord<Elegantbeef> It's an OS primitive is all I'm willing to say
06:52:42FromDiscord<Elegantbeef> It allows you to 'notify' another variable when an event happens afaik
06:55:08FromDiscord<Phil (he/him)> Okay so "wait" is the lock wait proc, you're waiting for the lock to release
06:55:08FromDiscord<Elegantbeef> As far as I can understand it's a way to prevent spin locking
06:55:46FromDiscord<Phil (he/him)> Now what does it mean to wait on a lock. Do you release the lock while you wait?
06:55:56FromDiscord<Phil (he/him)> And then acquire it again when the wait is over?
06:56:19FromDiscord<Phil (he/him)> Time to write an experiment
06:56:53FromDiscord<Elegantbeef> Or just read what `pthread_cond_wait` does 😄
06:57:21FromDiscord<Elegantbeef> sent a long message, see <!doctype html>
06:57:30FromDiscord<Elegantbeef> The mutex is the `Lock` in this case
06:58:14FromDiscord<Phil (he/him)> Hmmmmmmmm
06:58:46FromDiscord<Phil (he/him)> Isn't the consequence of that, that for a basic queue you really don't need 2 locks.↵It might be considered a performance optimization under heavy lock contention but I really can't imagine it, it makes things more complicated
06:58:55FromDiscord<Phil (he/him)> \basic threadsafe queue
06:59:47FromDiscord<Phil (he/him)> I'm asking because mratsim had a paper posted in the threading channel issue that was about it being changed to use 2 locks before that got reverted
07:00:09FromDiscord<Elegantbeef> leorize is a better person to ask
07:00:16*jkl quit (Quit: Gone.)
07:00:22FromDiscord<Elegantbeef> My knowledge with threading is limited to surface level
07:00:22FromDiscord<Phil (he/him)> How dare he sleep while I'm mildly hungover and curious
07:00:41FromDiscord<Elegantbeef> Hey he's in Canada iirc and it's saturday night.... he should be awake
07:00:44FromDiscord<Phil (he/him)> I assume he sleeps at leats
07:00:47FromDiscord<Elegantbeef> It's at most like 2\:30am
07:00:50FromDiscord<Phil (he/him)> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1193449121495920731): I assume he sleeps at least
07:01:19FromDiscord<Phil (he/him)> I'll be honest, for old folks like me that's late af and you should've gone to sleep 2h ago at least
07:01:33FromDiscord<Elegantbeef> It's 12am here
07:01:35FromDiscord<Elegantbeef> Fucking boomer
07:02:05FromDiscord<Elegantbeef> I'm saying at most it's 2\:30am(maybe 3\:30am) do not recall how far newfoundland is ahead of mountain time
07:02:06*jkl joined #nim
07:02:09FromDiscord<Phil (he/him)> 👴️
07:02:29FromDiscord<Elegantbeef> Might be 4\:30 hours ahead
07:02:42FromDiscord<wannabelokesh> it's 12\:32 pm here
07:02:51FromDiscord<Elegantbeef> Ah it's 3\:30 am
07:03:15FromDiscord<Elegantbeef> Exactly 12\:30 hours across the world from me
07:03:27FromDiscord<wannabelokesh> it's somebody living after 12\:32pm 7jan2024, can you predict future?
07:03:43FromDiscord<Phil (he/him)> Only the past
07:03:50FromDiscord<Phil (he/him)> The worlds shittiest superpower
07:05:04FromDiscord<wannabelokesh> predicting past. isn't that worthless?
07:05:23FromDiscord<Elegantbeef> Nah they have universities about palaeontology and history
07:06:49FromDiscord<Phil (he/him)> Depends on how much you like memories and remembering things
07:07:02FromDiscord<Elegantbeef> Here I though phil would've sobered up
07:07:07FromDiscord<Elegantbeef> thought\
07:07:34FromDiscord<wannabelokesh> ohhh, where I live, we have 11th and 12th standard, streams divided into 3 as med(if passed, can pursue doctors higher studies later), non-med(for engg basically), commerse(accounting, econimics, banking and all shtt) and arts(history, politics and all dumbA$$). ↵I chose non-med and it's like 5 years now.
07:08:16FromDiscord<Elegantbeef> So uhh Nim huh?
07:08:34FromDiscord<wannabelokesh> I love it. I took a diver so deeper, I could nver reach the surface/sealevel.
07:09:15FromDiscord<wannabelokesh> BTW, I wanna reach the space this room 'might be' a part of..? any idea?
07:09:52FromDiscord<Elegantbeef> [#nim\:envs.net](https://matrix.to/#/#nim:envs.net)
07:10:07FromDiscord<Elegantbeef> Risky thing to link a space to a matrix user
07:10:12FromDiscord<Elegantbeef> That's like 3 seconds away from spam
07:10:30FromDiscord<Elegantbeef> Fucking kidding me
07:10:31FromDiscord<favour4568> "I'll help anyone interested on how to earn 100k in just 24hours from the crypto market. But you will have to pay me my commission! when you receive your profit! if interested click on the group link and send me a direct message ↵https://t.me/+FGhsj-vpp7dmZDc0↵by asking me HOW
07:10:44FromDiscord<Phil (he/him)> But have you considered getting banned?
07:11:14FromDiscord<wannabelokesh> why? please expand that explanation
07:11:16FromDiscord<Phil (he/him)> Also Beef, perfect timing
07:11:17FromDiscord<Elegantbeef> Coincidence I think not!
07:11:39FromDiscord<Elegantbeef> Matrix has a spam issue
07:12:05FromDiscord<Elegantbeef> The absurd thing is it's always matrix.org
07:12:09FromDiscord<Elegantbeef> Never any other homeserver
07:12:50FromDiscord<Phil (he/him)> So you mean typically only rooms on the matrix.org server get targetted?
07:13:01FromDiscord<Elegantbeef> No this is envs.net
07:13:11FromDiscord<Elegantbeef> I mean that it's users on matrix.org
07:13:52FromDiscord<Elegantbeef> Wait no this is on matrix.org
07:13:53FromDiscord<wannabelokesh> what? why?
07:14:09FromDiscord<Elegantbeef> It's a free service that does not have any requirements like linking sms to talk
07:15:54FromDiscord<Elegantbeef> I just find it funny how it's always the `matrix.org` server, ostensibly if you wanted to spam it'd be quicker to host your own homeserver and then just join
07:17:02FromDiscord<sOkam! 🫐> is it possible to create a varargs function that has a non-vararg element at the end?
07:19:14FromDiscord<Elegantbeef> Yes
07:20:04FromDiscord<sOkam! 🫐> what has priority, the args or the static element?
07:20:21FromDiscord<Elegantbeef> the varargs if the next element is the same type
07:20:39FromDiscord<sOkam! 🫐> kk
07:21:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
07:21:35FromDiscord<sOkam! 🫐> yeah that's the idea
07:23:22FromDiscord<MDuardo> Hi↵Wanted to ask...↵Can you use Matplotlib in Nim?I managed to make Numpy to work but my brain can't manage Matplotlib
07:23:48FromDiscord<Elegantbeef> Arent there plotting libraries with bindings/ported?
07:24:35FromDiscord<MDuardo> Yeah but Nimpy made them redundant
07:24:46FromDiscord<Elegantbeef> Uh no
07:25:05FromDiscord<Elegantbeef> Relying on a python runtime and interop is not redundant it's hell
07:25:46FromDiscord<Phil (he/him)> Different usecases really
07:25:49FromDiscord<MDuardo> So the bindings are still worth it?
07:26:08FromDiscord<Elegantbeef> I'd rather not have python anywhere inside my toolchain so up to you
07:26:30FromDiscord<Phil (he/him)> For reference MDuardo\:↵Executing Python code will always be slower than executing equivalent well written nim code (the exception being where python actually calls into highly optimized C/Fortran libs like with numpy)
07:26:57FromDiscord<Phil (he/him)> It is also more complicated to distribute because now it's not just a binary and potentially assets, you also need to make sure the user has the necessary python version and python libs installed
07:27:25FromDiscord<Phil (he/him)> Numpy is still a highly useful project for... god damn that spammer is in offtopic
07:27:43FromDiscord<Elegantbeef> > the exception being where python actually calls into highly optimized C/Fortran libs like with numpy↵Well you arent calling python so no exception required
07:27:47FromDiscord<Phil (he/him)> No wait, wtf, that wasn't offtopic, that was the GTK channel
07:28:09FromDiscord<Phil (he/him)> As in, the spammer we just had now is in the official GTK Room, funny how that works
07:28:24FromDiscord<Elegantbeef> the gtk room is not on matrix.org is it?
07:28:52FromDiscord<Phil (he/him)> https://app.element.io/#/room/#gtk:gnome.org↵I think that's their own instance
07:28:58FromDiscord<Elegantbeef> Indeed
07:29:49FromDiscord<Phil (he/him)> anyway, Numpy is still really useful to even be able to integrate into python code bases or use python in nim code bases where speed and/or distributing it are not that much of a factor
07:31:06FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html>
07:32:03FromDiscord<Phil (he/him)> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1193455836446597210): Nimpy is still a highly useful project for... god damn that spammer is in offtopic
07:32:27FromDiscord<Elegantbeef> You need atleast 1 vararg to be able to skip it or to explicitly do `[]` or `other = 1` or an overload that has no varargs
07:32:34FromDiscord<Elegantbeef> The last is the one that does not work
07:32:52FromDiscord<sOkam! 🫐> oh 😦
07:33:08FromDiscord<sOkam! 🫐> then I need to send the args to the end
07:33:44FromDiscord<sOkam! 🫐> or, I guess I could create a non-varargs version for that case
07:34:35FromDiscord<Elegantbeef> Nah cause it's ambiguous
07:34:49FromDiscord<sOkam! 🫐> exactly what happened right now, lol
07:35:40FromDiscord<sOkam! 🫐> could there be a way out of it in some way?
07:35:54FromDiscord<Elegantbeef> `other = ...`
07:36:11FromDiscord<sOkam! 🫐> well the idea is to not need the qualifier
07:38:50FromDiscord<Elegantbeef> Well varargs go last then 😄
07:39:04FromDiscord<Elegantbeef> Varargs almost always should be last
07:40:00FromDiscord<sOkam! 🫐> but then i cannot do `thing 1,2,3,4, mything` and also `thing mything`... and would be forced to do `thing mything, 1,2,3,4`
07:40:05*Jjp137 quit (Ping timeout: 240 seconds)
07:41:01FromDiscord<odexine> Well how else is Nim supposed to distinguish
07:41:39FromDiscord<sOkam! 🫐> i was asking how to distinguish, not blaming nim
07:42:06FromDiscord<sOkam! 🫐> im just wondering if there is a way around it, so i don't have to varargs after, since the syntax im trying to mirror has the varargs before
07:42:27FromDiscord<odexine> No I believe not, not without extra fuckery
07:44:46FromDiscord<sOkam! 🫐> is there a way to require varargs to contain minimum 1item?
07:46:38FromDiscord<Elegantbeef> Nope they're fancy `openArray`s
07:48:46FromDiscord<Elegantbeef> You can cheese it with an overload that errors
07:49:39FromDiscord<rudy.in> uwu
07:49:48FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
07:50:10FromDiscord<Elegantbeef> The above forces atleast 2 for instance
08:24:35*redj quit (Remote host closed the connection)
08:27:04*redj joined #nim
08:43:14*xet7 quit (Remote host closed the connection)
09:09:26FromDiscord<sOkam! 🫐> is there a way to get a simple http server from a folder with live reload with nim?↵_i know about nimhttpd, but it does not do live reload and it fails to even update the contents_
09:11:46FromDiscord<Phil> Errr... how do you figure out which memory management strategy your user is running?↵Particularly asking because I kinda want to check for orc which is the default, but I don't want to have to do "when not defined every other strategy"
09:11:58FromDiscord<Phil> Specifically just want to figure out if system.roots exists, which only exists under orc afaik
09:12:24FromDiscord<Elegantbeef> `defined(orc)`
09:12:48FromDiscord<Elegantbeef> or is it `gcOrc`
09:28:06FromDiscord<sOkam! 🫐> how do you nest macros?
09:28:41FromDiscord<Elegantbeef> Huh?
09:28:49FromDiscord<sOkam! 🫐> i have a macro that returns type N, but im nesting it to overload it, and its returning NimNode, but i need it to return N to return the proper type 🤔
09:29:11FromDiscord<Elegantbeef> Stop returning `NimNode`
09:29:15FromDiscord<Elegantbeef> Make it return`untyped`
09:29:24FromDiscord<sOkam! 🫐> im not returning that, im returning my type
09:30:03FromDiscord<sOkam! 🫐> `Error: type mismatch: got 'HtmlNode' for 'newBody("", [])' but expected 'NimNode = ref NimNodeObj'`
09:30:14FromDiscord<Elegantbeef> What?
09:30:30FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html>
09:30:44FromDiscord<Elegantbeef> Your return type should be `untyped` for macros
09:31:10FromDiscord<sOkam! 🫐> it was working before nesting it, and i didn't write it originally
09:31:34FromDiscord<sOkam! 🫐> im just trying to add the functionality to say `bodys style="mystyle=properties": ...`
09:32:45FromDiscord<Elegantbeef> though you could also do `newCall(bindSym"bodys", inner)`
09:32:45FromDiscord<Elegantbeef> But you've just remade templates! 😄
09:33:37FromDiscord<sOkam! 🫐> i havent remade anything, im just hacking someone elses code to do what i want it to do
09:33:50FromDiscord<sOkam! 🫐> i have no idea if this is good code or bad code, im just hacking around
09:34:06FromDiscord<Elegantbeef> You have remade templates
09:34:46FromDiscord<sOkam! 🫐> sure, maybe you have the skill to do the things in proper ways. i don't. im just trying to add a `style=...` property to an existing library
09:35:27FromDiscord<sOkam! 🫐> if there is a better way, let me know in better ways. because i have no idea what I'm writing, as its usual with macros+me
09:49:19FromDiscord<requiresupport> whats a good replacement for threadpools module that was deprecated? I don't wanna have to change my code too much. Warning gives multiple options: `malebolgia`, `taskpools` or `weave`
09:50:24*Jjp137 joined #nim
09:51:41FromDiscord<whisperecean> How can I compile my nim project to produce a self-contained binary? I need libpq to be compiled in
09:54:25FromDiscord<sOkam! 🫐> @whisperecean you need to either static link to libpq, or distribute the dll with your app
09:58:08FromDiscord<whisperecean> How can I do that?
10:16:47FromDiscord<sOkam! 🫐> In reply to @whisperecean "How can I do": depends on the library and your buildsystem setup↵easiest way is to rely on the library's buildsystem, and then pass `--passL:/path/to/thelib.a`↵but your setup can vary wildly, so hard to give better specifics without understanding your app
10:21:45FromDiscord<whisperecean> Do you know how can I verify that it was statically linked?
10:21:54FromDiscord<whisperecean> i did -passL:-static
10:22:04FromDiscord<whisperecean> also having an issue building it on mac @m..@s..@s..@[email protected]@[email protected]:17:10: fatal error: 'sys/syscall.h' file not found
10:22:35*fallback quit (Ping timeout: 256 seconds)
10:23:11FromDiscord<graveflo> are you using a library or a module?
10:23:48FromDiscord<whisperecean> I am trying to statically compile my program that uses libpq
10:24:19FromDiscord<graveflo> on linux it should have `.a` extension to be a static library. Just making sure that is what you are working with
10:24:25FromDiscord<whisperecean> sent a long message, see <!doctype html>
10:24:35FromDiscord<whisperecean> Does that mean I am fine?
10:25:31FromDiscord<graveflo> Maybe someone else can chime in but those look like dynamic module addresses not statically compiled
10:25:56FromDiscord<Elegantbeef> Those are `.so` s those are dynamic libraries
10:26:12FromDiscord<Elegantbeef> Just ship the dlls
10:26:22FromDiscord<Elegantbeef> static linking is more of a pain to get through
10:26:38FromDiscord<whisperecean> I dont want to ship dlls (puke)
10:27:00FromDiscord<graveflo> there really are two types of people
10:38:22FromDiscord<whisperecean> Does anybody know how can I fix this? ssystem.nim.c:17:10: fatal error: 'sys/syscall.h' file not
10:38:26FromDiscord<whisperecean> Not related to static linking
11:14:38Amun-Rathat should be in default search path
11:16:36FromDiscord<whisperecean> What does this mean? Error: unhandled exception: field 's' is not accessible for type 'DbValue' using 'kind = dvkInt' [FieldDefect]
11:17:26Amun-Rasounds like it's an object variant
11:17:58Amun-Raand 's' field is defiled for other object kind than dvkInt
11:18:09Amun-Ra'https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants'
11:18:33Amun-Radefined*
11:27:32PMunchsOkam, replied to you GitHub issue now :)
11:29:16FromDiscord<whisperecean> postgres.nim(320) rawSelect↵Error: unhandled exception: Database select query . These errors are super hard to debug
11:30:46FromDiscord<sOkam! 🫐> In reply to @PMunch "sOkam, replied to you": just saw it! ty ty ✍️
11:31:03PMunchUnfortunately it's probably not the answer you wanted
11:31:23PMunchIf you do figure anything out though please let me know
11:31:40PMunchlibclang is quite terribly documented, and most of what I know about it is from trial and error
11:32:13FromDiscord<whisperecean> What can I do in this case? I dont understand a thing
11:32:26FromDiscord<whisperecean> I only get failed [DbError]...this is useless
11:32:50PMunchSharing some code will make it infinitely much easier for us to tell you what's going on
11:36:16FromDiscord<sOkam! 🫐> In reply to @PMunch "libclang is quite terribly": I very much noticed 😦
11:36:37FromDiscord<sOkam! 🫐> that's why I decided to ask, I didn't even understand the docs
11:37:38FromDiscord<sOkam! 🫐> what if you (or we, or whomever someone) wrote a parser just for understanding well-formed macros in some way? 🤔
11:38:01FromDiscord<sOkam! 🫐> how does c2nim solve this, in comparison?
11:38:05FromDiscord<whisperecean> I just have this: https://glot.io/snippets/gs8n1n5umn
11:38:39PMunchI mean that is basically what Futhark is doing already
11:38:49PMunchA parser for understanding macros
11:38:55PMunchIt's very limited though
11:39:05PMunchc2nim parses everything
11:39:05*antranigv quit (Ping timeout: 256 seconds)
11:39:17PMunchSo whatever macro support it has also applies here
11:40:10FromDiscord<whisperecean> How can I get a better output about what's wrong cuz this is useless
11:46:53FromDiscord<sOkam! 🫐> kk
11:47:58*gooba quit (Remote host closed the connection)
11:48:05NimEventerNew thread by choltreppe: Cleanly terminating a thread if it takes too long, see https://forum.nim-lang.org/t/10857
11:56:51FromDiscord<whisperecean> Anyone? :<
11:59:55FromDiscord<sOkam! 🫐> @ElegantBeef whats the simplest setup to `readFile( file.nims )`, evaluate it with nimscripter and get the value of a string or a function contained inside it?
12:00:15FromDiscord<sOkam! 🫐> (edit) "it" => "that string" | "it?" => "the script?"
12:00:34*antranigv joined #nim
12:00:40FromDiscord<sOkam! 🫐> In reply to @whisperecean "Anyone? :<": the question is very unclear, that's why nobody is answering
12:03:52*gooba joined #nim
12:07:54*antranigv quit (Ping timeout: 260 seconds)
12:08:05*xet7 joined #nim
12:09:46FromDiscord<whisperecean> Just as unclear as the exception...
12:10:00FromDiscord<whisperecean> I am doing a simple raw SQL select and dont get any meaningful result
12:10:05FromDiscord<whisperecean> what can be unclear about that?
12:10:13FromDiscord<graveflo> no one has a magic crystal ball
12:10:25FromDiscord<odexine> Need more details
12:10:29FromDiscord<whisperecean> But surely people do sql selects using nim
12:10:49FromDiscord<graveflo> tbh idk why anyone would do that
12:11:10FromDiscord<xtrayambak> woops, I've managed to freak the compiler out :P https://media.discordapp.net/attachments/371759389889003532/1193527246212845568/image.png?ex=65ad09de&is=659a94de&hm=17b3941d054ae9c8cbbc0d5b393827f33c018edcea0d255a1accf9c69d649ec5&
12:11:23FromDiscord<odexine> In reply to @whisperecean "But surely people do": Yes but more details about what was done is needed to understand the issue
12:11:45FromDiscord<whisperecean> @odexine I pasted a code snippet
12:12:08FromDiscord<odexine> I missed it
12:12:10FromDiscord<odexine> I’ll look
12:13:05FromDiscord<odexine> Do you mind posting the full error? I’m still not sure what’s wrong
12:13:06FromDiscord<xtrayambak> I'm messing around with macros, they're pretty fun
12:13:11FromDiscord<whisperecean> field 's' is not accessible for type 'DbValue' using 'kind = dvkOther -> I dont know where this comes from or how to get a more useful output
12:13:23FromDiscord<whisperecean> what even is a field 's' wtf
12:14:00*antranigv joined #nim
12:14:09FromDiscord<odexine> It’s one of the fields in the DbValue type
12:14:53FromDiscord<odexine> What library are you using?
12:17:02FromDiscord<whisperecean> norm and postgres
12:24:29*azimut joined #nim
12:27:37FromDiscord<odexine> I found one bug, the select has the wrong order
12:27:57FromDiscord<odexine> The fields on the object should have the same order on the query
12:28:15FromDiscord<whisperecean> Ok I can try that
12:28:23FromDiscord<whisperecean> Where did u see it mentioned?
12:28:32FromDiscord<odexine> I’m not sure if it will fix it though
12:28:40FromDiscord<odexine> https://norm.nim.town/apidocs/norm/postgres.html#rawSelect%2C%2Cstring%2CT%2Cvarargs%5BDbValue%2CdbValue%5D
12:29:40FromDiscord<whisperecean> I am trying to simplify the query but I dont think I can do what I want to do
12:30:08FromDiscord<whisperecean> I just want to do select user from useres where id = 454
12:30:22FromDiscord<whisperecean> I dont get it....
12:31:38FromDiscord<odexine> You probably shouldn’t use raw select
12:32:06FromDiscord<whisperecean> ......
12:32:20*deadmarshal_ quit (Remote host closed the connection)
12:33:48FromDiscord<whisperecean> I was trying to use raw select to have a minimal example as I dont know if I need the whole model for a table or I can have a partial one if I want to select just 2 fields
12:36:46FromDiscord<odexine> Well in that case he
12:36:48FromDiscord<odexine> Hm
12:36:55FromDiscord<Phil> You can have partial ones
12:37:12FromDiscord<Phil> As someone who uses norm extensively with partial models, that is very possible
12:37:39FromDiscord<whisperecean> so how can I just retrieve something from a table by id
12:37:48FromDiscord<asakura44> what is the difference between ``float`` and ``float64`` is ``float`` a c type or what ?
12:37:51FromDiscord<whisperecean> I dont get it...
12:38:22FromDiscord<asakura44> are u talking to me mate ?
12:38:42FromDiscord<whisperecean> no
12:38:47FromDiscord<whisperecean> I am talking about my problem.
12:39:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
12:39:33FromDiscord<whisperecean> waaat
12:39:39FromDiscord<whisperecean> I think Nim is too immature to use
12:40:50FromDiscord<asakura44> sent a code paste, see https://play.nim-lang.org/#ix=html>
12:41:27FromDiscord<Phil> In reply to @whisperecean "I think Nim is": I mean, there's other libs if that ORM doesn't suit you.↵IIRC Debby was another ORM, gatabase exists since you use postgres IIRC etc.
12:42:10FromDiscord<Phil> In reply to @asakura44 "why did not you": That's not what distinguishes those.↵const = cpompile time variable↵let = immutable runtime variable↵var = mutable runtime variable
12:42:12FromDiscord<whisperecean> I am not writing anything complex just wanted to retrieve some data for testing
12:42:18FromDiscord<Phil> (edit) "cpompile" => "compile"
12:42:43FromDiscord<xtrayambak> In reply to @whisperecean "I think Nim is": Nope, what makes you think that? From my usage, Nim is perfectly capable for anything any other language can do.
12:43:05FromDiscord<Phil> In reply to @asakura44 "what is the difference": No, float is an alias.↵When compiling on 64 bit systems, float is identical to float64 as in an alias of float64.↵On 32 bit systems it is identical to float 32
12:43:20FromDiscord<asakura44> In reply to @isofruit "That's not what distinguishes": what is the difference ?????
12:43:29FromDiscord<asakura44> let and const seems the same
12:43:52FromDiscord<asakura44> In reply to @isofruit "No, float is an": machine dependent ?
12:44:01FromDiscord<Phil> What's your background? As in, do you know what compiling is and does the word "compile time" ring a bell?
12:44:11FromDiscord<Phil> In reply to @asakura44 "machine dependent ?": OS dependent mostly.
12:44:20FromDiscord<asakura44> In reply to @isofruit "What's your background? As": of course i know
12:44:33FromDiscord<asakura44> compile time means before producing executable file
12:44:49FromDiscord<asakura44> that moment of actions we call it compile time
12:45:27FromDiscord<Phil> Aye. There can be a lot of computation you might want to do specifically then and not at runtime, const variables do for example not exist at runtime.↵What happens is their value gets copy pasted to wherever the variable is being used
12:45:33FromDiscord<asakura44> nim here ------ compile time here ----- executable here
12:45:54FromDiscord<asakura44> In reply to @isofruit "Aye. There can be": i see
12:45:56FromDiscord<whisperecean> In reply to @xtrayambak "Nope, what makes you": Literally the function phil posted
12:45:59FromDiscord<Phil> You might for example want to read in a config file when you build the binary
12:46:14FromDiscord<Phil> In reply to @whisperecean "Literally the function phil": That was for me doing a larger application for a generic repository. You can of course do it much simpler
12:46:35FromDiscord<whisperecean> In reply to @isofruit "I mean, there's other": But if i define partial model can i at least retrieve by those other properties easily?
12:46:57FromDiscord<Phil> This was the maximum convenience way for me.↵hard code the table name, inline the query params, not even sure you need the explicit dbValue conversion as it should do that implicitly
12:49:59FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
12:50:12FromDiscord<xtrayambak> In reply to @whisperecean "Literally the function phil": It seems like he tried do a fix-it-all type of solution, you can obviously narrow it down to your personalized needs
12:51:04FromDiscord<Phil> In reply to @xtrayambak "It seems like he": I was, I used this kind of function for basically hundreds of different queries and wanted a rock solid base to generalize on top of that was mildly more convenient than norms default one (which requires you to instantiate a model yourself)
12:51:47FromDiscord<Phil> In fact you can even narrow the above down and replace morel with "result" entirely
12:51:54FromDiscord<Phil> (edit)
12:52:13FromDiscord<Phil> (edit) "morel" => "model"
12:55:33FromDiscord<xtrayambak> Btw, does anyone know how to use format specifiers?
12:55:52FromDiscord<xtrayambak> I can't figure out how, the only thing I found was a simple text "diagram"-thing in the docs
13:15:42FromDiscord<whisperecean> @phil
13:15:51FromDiscord<whisperecean> @Phil I tried that but it does not work...
13:16:53FromDiscord<Phil> Generally it helps to write minimal example and provide the error message it writes
13:17:06FromDiscord<Phil> (edit) "example" => "examples"
13:17:54FromDiscord<whisperecean> Ah wait I had rawselect there
13:19:41FromDiscord<whisperecean> But do you have to have the id in the model or that is implicit?
13:20:04FromDiscord<Phil> Your type inherits from Model no?
13:20:07FromDiscord<Phil> That has an id field
13:20:21FromDiscord<whisperecean> ref object of Model yes
13:20:35FromDiscord<Phil> You get the id field through the inheritance
13:23:44FromDiscord<whisperecean> Does this make sense? https://glot.io/snippets/gs8pyoc5je
13:25:25FromDiscord<Phil> You can simply do `Users(user: user, uuid:uuid)`, that is equivalent to your newUsers proc
13:26:41FromDiscord<whisperecean> Ok done.
13:27:13FromDiscord<whisperecean> Getting type mismatch for the .select...checking it
13:30:05FromDiscord<whisperecean> No idea...
13:30:05FromDiscord<whisperecean> https://glot.io/snippets/gs8q50j0qr
13:32:42FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
13:33:09FromDiscord<Phil> This is an example using an in-memory db, but the logic applies for postgres as well
13:34:55FromDiscord<whisperecean> Which is what I am doing
13:34:56FromDiscord<whisperecean> ...
13:35:18FromDiscord<whisperecean> But in the error...which field is even the mismatch?
13:36:37FromDiscord<Phil> Show the line of code here.↵One likely issue is you used let to instantiate the model
13:38:24FromDiscord<whisperecean> Nope using var
13:39:42FromDiscord<Phil> I mean without seeing the surrounding code as in how you instantiate the model etc. there's not that much I can say
13:40:29FromDiscord<odexine> In reply to @isofruit "No, float is an": It is not, floats are always 64 bit no matter the architecture IIRC
13:41:06FromDiscord<Phil> > the generic floating-point type; its size used to be platform-dependent, but now it is always mapped to float64. This type should be used in general.↵I was sitting on outdated information
13:41:49FromDiscord<whisperecean> Yes sorry just hard to strip out the sensitive data
13:41:57FromDiscord<whisperecean> I figured it out...it was caused by norm/[model,sqlite,postgres]
13:42:47FromDiscord<Phil> that should lead to an ambiguous call error, not ty... you used a postgres db connection with an sqlite select proc didn't you
13:43:00FromDiscord<whisperecean> looks like
13:43:12FromDiscord<whisperecean> but how do I use it with postgres select?
13:44:02FromDiscord<Phil> I mean, first why not remove the sqlite import?
13:44:54FromDiscord<whisperecean> I want to read some data from postgres db and save it locally to a sqlite one
13:45:02FromDiscord<Phil> ahhhhh check
13:46:14FromDiscord<Phil> This kind of stuff is why seeing a full minimal example helps. There's 50 things potentially going on and you're asking me for a blind diagnosis 😛
13:46:41FromDiscord<whisperecean> Yeah agree sorry for that
13:47:18FromDiscord<Phil> What the error tells you is there's 4 "select" procs defined by norm.↵2 are for postgres, 2 for sqlite.↵The first 2 are for whatever db the connection you have is not for (see the 1 at the start, that is the number of the parameter where the mismatch happens)
13:47:59FromDiscord<Phil> the third proc says "can't be me, the connection fits but I'm for sequences, not individual models", so that's not the one you're looking for
13:48:01FromDiscord<whisperecean> That's weird but is not visible to me from the error :/
13:48:36FromDiscord<Phil> the 4th one complains that 414 is not a dbValue type (which norm should auto convert from whatever you input to dbValue).
13:48:44FromDiscord<Phil> You can force the issue here by writing 414.dbValue() instead
13:48:55FromDiscord<Phil> or 454 I think
13:49:19FromDiscord<whisperecean> That gives ambigious call but shows sqlite select
13:49:28FromDiscord<Phil> Yes, now we're cooking
13:49:35FromDiscord<Phil> This is the error you should've had in the first place 😄
13:49:48FromDiscord<Phil> to tell it specifically to use the sqlite proc, you can prefix with the module name
13:49:56FromDiscord<graveflo> `dbConn; obj: var T` first and second parameter bound to the same type?
13:49:57FromDiscord<Phil> sqlite.select(dbCon, test.... etc.)
13:50:26FromDiscord<Phil> In reply to @graveflo "`dbConn; obj: var T`": dbConn is defined using `using` which is why the type doesn't show up in the error message
13:50:32FromDiscord<Phil> Just for general reference
13:50:45FromDiscord<whisperecean> so what should I do when I want to use postgres select? 😦
13:50:48FromDiscord<Phil> Not a fan of `using` myself, that fact just ads to it
13:50:54FromDiscord<whisperecean> postgres.select(dbCon, model....)?
13:51:09FromDiscord<Phil> In reply to @whisperecean "so what should I": first, different connection because your current connection is to the sqlite db
13:51:18FromDiscord<Phil> But yeah, after that postgres.select(dbCon, model) etc.
13:51:42FromDiscord<whisperecean> hmmm nope that does not seem to be it
13:51:47FromDiscord<whisperecean> my connection in open is postgres
13:51:56FromDiscord<asakura44> what does the range keyword do in nim ? is it the same as .. ?
13:52:25FromDiscord<whisperecean> I am doing just let dbcon = postgres.open(DB_HOST, DB_USER, DB_PASS, DB_NAME)
13:53:39FromDiscord<whisperecean> Ahhh i am going nuts
13:53:49FromDiscord<whisperecean> this types should help instead they just obfuscate the issue
13:53:53FromDiscord<whisperecean> (edit) "this" => "these"
13:56:34FromDiscord<whisperecean> In reply to @isofruit "But yeah, after that": This also does not work. It's still sqlite as far as I can see from the 454.dbValue()
13:56:57FromDiscord<Phil> Still no crystal ball to infer what that exactly means
13:57:05FromDiscord<Phil> Or what error you see
13:57:57FromDiscord<whisperecean> see the same error like i am calling sqlite select
14:00:13FromDiscord<Phil> I mean, I still can not magical crystal-ballify what your code is, so hard to help.↵One quicker way that'll avoid some headache would be to just not use them in the same module and instead have them in separate files.
14:00:38FromDiscord<Phil> That or jumping to e.g. debby
14:01:46FromDiscord<whisperecean> Nim is too immature to use :<
14:01:59FromDiscord<Phil> Brave thing to say after using one library.
14:02:30FromDiscord<whisperecean> But it should be obvious and easy to call function for appropriate type
14:02:35FromDiscord<whisperecean> Instead the error does not event show it
14:04:02*rockcavera joined #nim
14:05:27FromDiscord<Phil> It is trying to do that.↵What it can't do is do so when something is ambiguous. ↵In this case that is likely dbvalue since both sqlite and postgres have their own way procs for translating fields into column-types that overlap here. ↵It's basically the way norm was built in this case that does not work well for how you want to use it.
14:07:32FromDiscord<whisperecean> But I cant seem to force it to use the postgres select...
14:09:18FromDiscord<whisperecean> Should not that also be pretty straightforward?
14:10:15FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
14:11:14FromDiscord<whisperecean> I dont mind specifying the modules I just dont know how and where...
14:11:17FromDiscord<Phil> Because both have that proc defined.↵And because this is internal inside norm where that disambiguation is happening you can't really get at it.↵That's the oversight that's killing you here and just demonstrates the modules weren't written with the intention of using both at the same time
14:11:36FromDiscord<whisperecean> I see
14:11:39FromDiscord<whisperecean> That's pretty bad
14:12:08FromDiscord<Phil> Imagine me throwing my hands in the air, it is free software
14:12:16FromDiscord<whisperecean> Ok let me try to just get the data at least with the select
14:13:11FromDiscord<whisperecean> Do you think It's possible to workaround it?
14:13:19FromDiscord<whisperecean> like do the imports in different files
14:13:29FromDiscord<Phil> Just use them in separate modules
14:13:29FromDiscord<Phil> Yeah exactly that
14:14:34FromDiscord<Phil> Have one module provide a proc "loadData" and the other "writeData" and bam, abstraction
14:17:53FromDiscord<whisperecean> This is bs...this just does not work
14:18:03FromDiscord<whisperecean> I spent the whole day just trying to get a simple sql select working
14:19:33FromDiscord<whisperecean> I get a query back when executing it: SELECT "users".user, "users".uuid, "users".id FROM "users" WHERE users.id = ? LIMIT 1
14:19:49FromDiscord<whisperecean> when I execute this manually and replace ? with the id it just works
14:19:52FromDiscord<whisperecean> in the sql console
14:19:59FromDiscord<whisperecean> But here i get a DbError...
14:20:00FromDiscord<whisperecean> like wtf
14:22:49FromDiscord<Phil (he/him)> I mean, if this is just to vent, fair, if you expect help, crystal balls have never been further away from me
14:26:12PMunch@whisperecean, if you want help, share code
14:26:22PMunchOtherwise we're basically just guessing
14:26:24FromDiscord<whisperecean> This is literally what I have
14:26:26FromDiscord<whisperecean> https://glot.io/snippets/gs8roullyl
14:26:29FromDiscord<whisperecean> Just this nothing more.
14:26:35FromDiscord<whisperecean> users is a table with lowercase
14:29:59PMunchAnd I assume you've printed out your credentials and stuff to make sure those get passed in correctly?
14:31:12PMunchAre you sure you're supposed to use a question mark?
14:31:30PMunchJudging by the tests in norm it seems like you're supposed to use $1
14:32:41FromDiscord<whisperecean> Yes I can connect (printed out the creds).
14:32:50FromDiscord<whisperecean> @Phil posted ? and it's also in the examples
14:33:12FromDiscord<Phil> For sqlite, yes, the examples are also all for sqlite
14:33:25FromDiscord<whisperecean> lol....
14:33:46FromDiscord<Phil> > Also, make sure you have SQLite installed. On most Linux distributions, it should be preinstalled. To install SQLite in macOS, use brew. On Windows, use scoop. Should you want to follow this tutorial while using postgres, then please be aware that placeholders in postgres are not indicated with ?, but with $1, $2, $3... etc. instead.
14:33:57FromDiscord<Phil> > Should you want to follow this tutorial while using postgres, then please be aware that placeholders in postgres are not indicated with ?, but with $1, $2, $3... etc. instead.
14:36:40FromDiscord<whisperecean> Yeah it does not work with with that either
14:37:11FromDiscord<whisperecean> remoteState.select(test, "users.id = $1", 454)
14:38:27FromDiscord<whisperecean> Error: unhandled exception: field 's' is not accessible for type 'DbValue' using 'kind = dvkInt' [FieldDefect
14:38:59PMunchCould you pastebin the whole error?
14:39:01FromDiscord<Phil> Mark your fields as exported
14:39:16FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
14:39:40FromDiscord<graveflo> does the number have tot be a string there?
14:39:47FromDiscord<graveflo> (edit) "tot" => "to"
14:40:35FromDiscord<Phil> No wait this is about s
14:40:40FromDiscord<Phil> not your own fields
14:40:43FromDiscord<graveflo> looks like an object variant with an integer type enum `dvkInt`
14:41:22FromDiscord<whisperecean> if i put "454" i get a failed select query
14:41:30FromDiscord<whisperecean> so that gets rid of the error with field 's'
14:41:52FromDiscord<whisperecean> hmm getting somewhere
14:42:00FromDiscord<whisperecean> remoteState.select(test, "users.id = $1", test.id) if I do this
14:42:04FromDiscord<whisperecean> I get No record found
14:42:27FromDiscord<whisperecean> So I guess i just have to find out how to test.id to 454
14:43:21FromDiscord<whisperecean> but how...
14:43:43FromDiscord<graveflo> idk ive never "test.id to 454" before
14:44:43FromDiscord<whisperecean> sigh
14:51:31PMunchI was about to install postgres to see if I could help up, but my system was a bit outdated so I'm doing a large update instead..
14:52:41FromDiscord<whisperecean> Thanks for that but you should not have to install postgres to debug this that's bs
14:53:01FromDiscord<whisperecean> How can we not figure out how to retrieve data from postgres using an ID
14:53:03FromDiscord<whisperecean> that's ridiculous
14:53:11FromDiscord<whisperecean> That's like basic functionality
14:54:13PMunchI assume you're just doing something silly
14:54:17PMunchSo I wanted to look for myself
14:54:24PMunchBecause as you said this shouldn't be hard
14:54:41PMunchBut I've never used norm before so without trying it myself I'm not sure what's going on
14:55:36FromDiscord<whisperecean> remoteState.select(test, "users.id = $1", test.id) i am pretty sure here it understands I want an ID
14:55:41FromDiscord<whisperecean> but i cant tell it the number
14:58:12PMunchHmm, what happens if you put an `id: int` field in your `user` type?
14:58:37FromDiscord<whisperecean> Redifinition error
14:58:48FromDiscord<whisperecean> sent a long message, see <!doctype html>
14:59:04PMunchAh right
14:59:09PMunchThat makes sense
15:00:21FromDiscord<whisperecean> If I do before test.id = 454 and then pass test.id in the select I get the field 's' is not accessible for type 'DbValue' using 'kind = dvkInt'
15:00:51PMunchWhat is the schema of your database by the way?
15:01:32FromDiscord<whisperecean> I think you got it
15:01:57FromDiscord<whisperecean> I am not setting the schema anywhere
15:02:33FromDiscord<whisperecean> But I dont see where?
15:03:14PMunchHuh?
15:03:29PMunchI mean you have an existing database don't you?
15:04:12FromDiscord<whisperecean> Database->schemas->tables
15:04:17FromDiscord<whisperecean> So where do I set the schema?
15:04:32FromDiscord<mengu> https://norm.nim.town/tutorial/tables.html
15:04:35PMunchI have no idea what that path is supposed to mean
15:04:54PMunchThe schema is the definition for how your tables are defined
15:05:08FromDiscord<mengu> if you haven't ran `createTables` then you won't have a schema unless you created via sql
15:05:12PMunchEvery SQL database (except perhaps an empty one), has a schema
15:05:18FromDiscord<Phil> The models are the schema essentially.
15:05:45FromDiscord<Phil> The model defines which table it is associated with, the fields define which columns must exist (there may be additional ones which norm will ignore)
15:06:07FromDiscord<whisperecean> In reply to @mengu "if you haven't ran": But I am not creating a database or tables or schemas. I am trying to read from it
15:06:12FromDiscord<Phil> (edit) "ignore)" => "ignore if there are no fields for those columns)"
15:06:34PMunchYeah, and I'm guessing that the `field 's' is not accessible for type 'DbValue' using 'kind = dkvInt'` might come from norm trying to assign some incompatible type
15:06:35FromDiscord<Phil> All that should be needed to be done is define a datatype and use the select proc with a connection to that db
15:07:06FromDiscord<Phil> essentially it's trying to have a string where there is an int
15:07:09FromDiscord<mengu> In reply to @whisperecean "But I am not": ah, sorry, I thought you didn't have a db schema, misunderstood
15:07:35FromDiscord<whisperecean> The database has many schemas and I am trying to read data from a particular table from a particular schema
15:07:39FromDiscord<Phil> Which is either when creating the query or when parsing the response back
15:07:44FromDiscord<whisperecean> but now I realized I dont specify the schema anywhere
15:08:01FromDiscord<whisperecean> But I dont understand how to do this
15:08:58FromDiscord<Phil> For the most part what norm does is string generation.↵I'd say abuse the `tableName` pragma to pass in `<schemaname>.<tablename>` and see if it generates the correct SQL
15:09:16FromDiscord<Phil> Well "abuse", this is likely one of the reasons why it exists
15:10:20FromDiscord<whisperecean> trying to find out how
15:13:52FromDiscord<whisperecean> Yeah I dont know
15:13:57FromDiscord<whisperecean> think I will just abandon nim
15:14:31FromDiscord<Phil (he/him)> I mean I suggested Debby... Like twice
15:15:18FromDiscord<whisperecean> But I am risking into running into debbie issues
15:15:24FromDiscord<whisperecean> I dont even know if that solves my problems
15:17:06FromDiscord<odexine> you could say the same with switching languages unless its to one you already know
15:18:07FromDiscord<whisperecean> I have a working Python solution I was just wondering if I could use Nim....
15:19:32PMunchYou definitely can
15:19:52FromDiscord<graveflo> for a task like this if you have working python code and you don't need the advantages that Nim naturally has, then I would call you crazy for using Nim instead
15:27:27FromDiscord<whisperecean> Well still pretty frustrating experience and we did not even figure out how to do a simple select
15:28:00FromDiscord<graveflo> just use python
15:29:39PMunchOkay, update done
15:29:43PMunchPostgres installed
15:29:46PMunchLet's see
15:31:50FromDiscord<whisperecean> If you want to test it i have a postgres database which has many schemas. My table is in the public schema.
15:32:54PMunchThat'd be great
15:34:25FromDiscord<whisperecean> I think u can just create 2 schemas
15:34:35FromDiscord<whisperecean> Just so it does not auto connect or something
15:39:20FromDiscord<whisperecean> Well another problem I might face later is that uuid in postgres is not string
15:40:26PMunchDid you see this by the way? https://norm.nim.town/debug.html
15:40:44PMunchThat could very well be the issue you are currently facing
15:40:51FromDiscord<whisperecean> But just slap there 2 colums with strings
15:40:52PMunchIt's probably stored as a numerical value
15:41:24PMunchCould you try to set `uuid: int` in your sample?
15:42:30FromDiscord<whisperecean> No I think my problem is with the schemas
15:42:35FromDiscord<whisperecean> and fetching by id
15:42:40FromDiscord<whisperecean> I removed the uuid field completely
15:45:53FromDiscord<whisperecean> I am gonna hit the gym but will be back in an hour. If you will still give it a try :<
15:51:18PMunchHmm, interesting
15:51:51*deadmarshal_ joined #nim
15:51:54PMunchUsing Norm on a fresh postgres install with an empty database and calling `createTables` gave me a syntax error in the SQL query..
16:08:23FromDiscord<whisperecean> Maybe its broken
16:23:58*PMunch quit (Quit: leaving)
16:50:07FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html>
16:50:31*azimut quit (Ping timeout: 240 seconds)
16:51:53*azimut joined #nim
16:52:14FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html>
16:54:41*deadmarshal_ quit (Quit: IRCNow and Forever!)
16:58:48*xet7 quit (Remote host closed the connection)
16:58:50*fallback joined #nim
17:03:48FromDiscord<Phil> In reply to @whisperecean "Maybe its broken": Part part.↵Postgres syntax the way you need to write it here with the table access is really fucking weird it turns out.
17:03:56FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
17:04:12NimEventerNew thread by ASVI: Why nim don't allow it ?, see https://forum.nim-lang.org/t/10858
17:04:36FromDiscord<Phil> I may have made some changes here or there to experiment, I keep forgetting about how postgres requires you to put your table name in quotation marks sometimes
17:04:51FromDiscord<Phil> Which is case sensitive mind you
17:08:03FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
17:16:20*deadmarshal_ joined #nim
17:59:24FromDiscord<whisperecean> Oh nice! I am gonna try it.
18:02:31FromDiscord<whisperecean> It's still does not work for me cuz of the schema
18:02:49FromDiscord<Phil> in your case try changing tableName to "<scheme>.users"
18:03:06FromDiscord<Phil> where you type in your own scheme into it
18:03:41FromDiscord<whisperecean> Yes tried but it does not work. I am trying to paste the query to sql console without schema to see if it's the correct query
18:04:50FromDiscord<Phil> @moigagoo if you've got time.↵Other than that I'm occupied with channels and really don't have the minspace right now
18:04:58FromDiscord<Phil> (edit) "minspace" => "mindspace"
18:05:46FromDiscord<Phil> You can try rawSelect which should do it, but remember to specify the columns in order, or try Debby
18:06:54FromDiscord<whisperecean> I think I got it
18:07:04FromDiscord<whisperecean> I mean I have the raw SQL that works from a different schema
18:07:09FromDiscord<whisperecean> so now need to translate it to norm
18:08:13FromDiscord<Phil> Generally norm is just a query generator for a few bits.↵It saves you the SELECT and the FROM block, what you specify after is typically just WHERE and later
18:08:29FromDiscord<whisperecean> SELECT "public".users.status, "public".users.id FROM "public".users WHERE "public".users.id = 454 LIMIT 1
18:08:32FromDiscord<whisperecean> This is how it should be
18:08:56FromDiscord<whisperecean> At least this is what works in sql console from a different schema
18:09:28FromDiscord<Phil> Ah, just for reference, triple quotes are just multi-line-strings
18:10:29FromDiscord<whisperecean> But how do i do this?
18:10:42FromDiscord<whisperecean> I cant do this with tableName pragma i think
18:11:05FromDiscord<Phil> Look at the SQL that gets generated via the logger
18:11:12FromDiscord<Phil> See where the generated SQL differs from yours
18:11:33FromDiscord<whisperecean> Yeah i see the sql in failed query
18:11:52FromDiscord<Phil (he/him)> No, look at the exact log message
18:14:33FromDiscord<whisperecean> I know but I cant do what I want to do
18:14:36FromDiscord<whisperecean> I mean I dont know how lol
18:14:51FromDiscord<whisperecean> i nead to add the schema with quotes "public".users.status
18:26:28FromDiscord<whisperecean> It works for the """user.id = 3 """
18:26:39FromDiscord<whisperecean> but dont know how to do it for users 😄
19:18:48FromDiscord<whisperecean> If anybody else has an idea…
19:25:00*jmdaemon quit (Ping timeout: 268 seconds)
19:48:32FromDiscord<aintea> Is there a naming convention for an object constructor ?
19:52:53FromDiscord<aintea> For example, I have this
19:53:32FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#ix=html>
19:59:45FromDiscord<leorize> `newTypeName`
20:02:06FromDiscord<griffith1deadly> initTypeName for `object`, newTypeName for `ref object`
20:11:23FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:11:48FromDiscord<Elegantbeef> It is ideal as you can use it with generics
20:12:09FromDiscord<Robyn [She/Her]> This way, you'd run `Type.init` or `MyType.new`, and I like the syntax personally so
20:12:16FromDiscord<Robyn [She/Her]> (edit)
20:55:33FromDiscord<ambient3332> It's a little awkward when on Windows other parts of the program only work on --cc:gcc and others work only with --cc:vcc 😦
20:58:33FromDiscord<Elegantbeef> Smells like UB
20:59:10FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=html>
20:59:37FromDiscord<Elegantbeef> Ah I take it back
21:02:40FromDiscord<Phil> I am a strong advocate for my way
21:02:51FromDiscord<Phil> Well for the only sensible way imo, can't claim it for myself
21:03:25FromDiscord<Phil> How the hell things about contructors and goes "I'mma just do a very long proc name that will not mesh with overloading at all"
21:03:30FromDiscord<Phil> (edit) "How" => "Who"
21:03:35FromDiscord<Phil> (edit) "things" => "thinks"
21:05:17FromDiscord<Phil> Ideally all your params have default assignments so you can always do `new(ProgrammingLanguage)`
21:15:04*lucasta joined #nim
21:31:11*redj quit (Ping timeout: 245 seconds)
21:32:33*redj joined #nim
21:39:21*Guest99 joined #nim
21:41:51*lucasta quit (Quit: Leaving)
21:44:26*Guest99 quit (Quit: Client closed)
21:55:10FromDiscord<ambient3332> I had to put "C:\Users\hyppa\.choosenim\toolchains\mingw64\bin" into path as it doesn't seem to be put automatically
21:55:28FromDiscord<ambient3332> (edit) ""C:\Users\hyppa\.choosenim\toolchains\mingw64\bin"" => ""C:\Users\hyppa\\.choosenim\toolchains\mingw64\bin""
21:56:03FromDiscord<ambient3332> Plus windows giving error message as a dialog pop up that doesn't show up in some terminals... oof
22:01:58FromDiscord<whisperecean> hmm figured the query does not need to be quoted
22:03:30FromDiscord<whisperecean> This is nuts
22:03:40FromDiscord<whisperecean> either none of it is quoted or just the schema
22:03:44FromDiscord<whisperecean> I am really going insane 😄
22:07:31FromDiscord<whisperecean> ok at this point i think only @moigagoo knows
22:37:43*azimut quit (Ping timeout: 240 seconds)
22:49:50FromDiscord<Robyn [She/Her]> In reply to @isofruit "Ideally all your params": What if macro for constructor proc
22:50:25FromDiscord<Robyn [She/Her]> Literally just something like `Type.constructor(param: Type, anotherParam = value) =`
22:50:39FromDiscord<Elegantbeef> https://github.com/beef331/constructor#struct-intialisers who if
22:51:40FromDiscord<Elegantbeef> You idea is pointless cause you can just do `T(param: ..., anotherParam: ...)`
22:52:14FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "https://github.com/beef331/constructor#struct-intia": Oh fun
22:52:20*entikan joined #nim
22:52:38FromDiscord<Robyn [She/Her]> > `asset`
22:52:52FromDiscord<Elegantbeef> PRs welcome 😛
22:53:21FromDiscord<Robyn [She/Her]> Ah yes lemme PR a single thing to the README
22:53:31FromDiscord<Elegantbeef> I mean you can
22:53:56FromDiscord<Elegantbeef> But I already fixed it
22:53:58FromDiscord<Elegantbeef> So yea
22:54:13entikanhow do I give an alternate name to a function?
22:54:26FromDiscord<Robyn [She/Her]> Lol
22:54:32FromDiscord<Elegantbeef> use another proc or a template
22:54:44FromDiscord<Elegantbeef> Or use a variable like `let myOtherProc = myProc`
22:54:50FromDiscord<Robyn [She/Her]> In reply to @entikan "how do I give": `template myAlias: typeof myProc = myProc`?
22:55:11FromDiscord<Elegantbeef> That's less than ideal though cause `myAlias()(...)` is required
22:55:40FromDiscord<Robyn [She/Her]> Mine doesn't work yeah
22:55:50FromDiscord<Elegantbeef> I mean it does
22:55:52FromDiscord<Elegantbeef> It's just not nice
22:56:02FromDiscord<nnsee> `const aliasedProc = oldProc` ?
22:56:20FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "It's just not nice": Yeah :p
22:56:22FromDiscord<nnsee> oh beef already said that
22:56:29FromDiscord<Robyn [She/Her]> In reply to @nnsee "`const aliasedProc = oldProc`": This works
22:56:29FromDiscord<Elegantbeef> That works aswell but not on closures
22:56:37FromDiscord<Robyn [She/Her]> He said `let` 😛
22:56:39FromDiscord<Elegantbeef> So all depends on what the proc is
22:57:27FromDiscord<nnsee> how to do this when there are multiple procs with different type signatures though
22:57:28entikanah yeah, let or const would be ambiguous in this case
22:57:38entikanexactly
22:57:43FromDiscord<Robyn [She/Her]> Ah so then a template is the only real way
22:57:51FromDiscord<Elegantbeef> `const myProc = (proc(_: Arg, _ Arg2))(name)`
22:57:57FromDiscord<Robyn [She/Her]> You'd have to put the params into the template
22:58:03FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "`const myProc = (proc(_:": You can do thT?
22:58:09FromDiscord<nnsee> TIL
22:58:16FromDiscord<Robyn [She/Her]> (edit) "thT?" => "that?"
22:58:17FromDiscord<Robyn [She/Her]> Damn
22:58:39FromDiscord<Robyn [She/Her]> Time to make a package that adds the British spellings to every American word-
22:58:43entikanso for each overflow I'd need a seperate template?
22:58:46FromDiscord<Robyn [She/Her]> Using aliases only
22:59:07FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "`const myProc = (proc(_:": Beefs solution seems good, he tends to know more than me :p
22:59:11FromDiscord<Elegantbeef> Overload\
22:59:20entikaneuh yeh, overload
22:59:21FromDiscord<Elegantbeef> Why are you aliasing procedures like this anyway
22:59:46entikanbecause I'm using a library that has some long as variable names I'd like to call a lot
22:59:51entikaneuh proc names
23:00:19entikanso, sugar
23:00:34entikanI like my code petite and sweet
23:04:27entikanin this specific case it's `initLVector4f()` I'd much rather have that be vec4, but it has 6 overloads
23:15:59*azimut joined #nim
23:16:35*lucasta joined #nim
23:59:13FromDiscord<voidwalker> Anyone have experience building ridesharing/carpooling, or any sort of geolocation based matching service ? I wonder if nim would be a good fit to build the backend of something like that. Probably not, given the lack of devs, being a rather specialized domain (to implement optimally), lack of libs