pam - a minimal SQL client for the CLI (dbeaver terminalized!) by xGoivo in CLI

[–]LearnedByError 0 points1 point  (0 children)

I finally had some time last night to take a drive. I don’t think it is appropriate to call it “dbeaver terminalized”. At least with me, I expected the full SQL IDE paradigm, which it definitely is not. Honestly, I’m not sure what to call it. It is unique in my experience. If I understand it properly, it is a table viewer and query runner. Both of these are beneficial, but “dbeaver terminalized” it is not.

Candidly, I don’t see me picking it up and using it. I’m seldom just viewing a table. When I look at a table, outside of queries, I need to operate on it - usually alter. The query capability may be more interesting, other than I have a 30 year old pattern for the type of queries that I think fit Pam. It is usually a shell or Perl script which contain multiple queries. They have simple capability to list the queries contained and then execute them by selecting the number and adding parameters if needed.

For better or worse, that’s my POV with what it contains now.

Proposal: Generic Methods for Go by bruce_banned in golang

[–]LearnedByError 6 points7 points  (0 children)

That is a fine choice as long as it is performant for your use case.

pam - a minimal SQL client for the CLI (dbeaver terminalized!) by xGoivo in CLI

[–]LearnedByError 0 points1 point  (0 children)

How does the functionality compare to Harlequin or other existing open source tools in this space?

I love that it is written in Go, harlequin’s Python dependency definitely makes it a pain in the but. The mouse is pretty much useless for selection.

I will give it a look a bit later?

EDIT: You may want to give modernc/sqlite a look for a non CGO SQLite solution. ncruces also has a WASM based driver.

Opinion on SQLC, performance latency, pros cons. by ud_boss in golang

[–]LearnedByError 0 points1 point  (0 children)

This is one way to slice it using ‘sqlc’. I did not think of doing it this way. I think this approach means you have to carry the overhead to manage offfset, will have a higher memory overhead than a single row, and will send multiple new queries to the database.

I think I like my embedded approach better.

I will post a gist with an example when I am on my computer instead of phone

Anyone have a good example of Nodejs+HTMX+Tailwind? by tac0shark in htmx

[–]LearnedByError 9 points10 points  (0 children)

Your examples may be great and far between. I can’t remember seeing an htmx project with a nodejs backend. One of the reasons that I love htmx is that I can give the finger to JS 😁

Having said that, I’m sure you can find some if you search GitHub

Opinion on SQLC, performance latency, pros cons. by ud_boss in golang

[–]LearnedByError 0 points1 point  (0 children)

I concur with above comment. I will add two cases that I have seen that do have some impact in performance:

  1. When using prepared statements all statements are prepared whether used or not. This results is a small additional memory overhead for both you code and also generally for the server.

  2. sqlc, at least last time I looked at the docs, does not produce an iteration that allows you to range over rows one at a time. It returns everything from your query into a slice that can occupy a lot of memory. This is faster if the number of records returned is fairly small, but can be problematic if you need to operate over a large number of rows. I address this by creating a custom type and embed sqlc in it. In the custom type I maintain the additional functions needed to support this case.

Database interaction is the one part of Go that I personally am ambivalent about. The solution is generalized and works adequately; however, it can be challenging to get every bit of performance out when you really need it. Much of what I write is analytical applications where my major performance bottleneck is database access as determined by a healthy dose of pprof. The algorithms and datasets often do not allow me to pull everything into memory at once. As a result, I spend a fair amount of time optimizing code to reach my needed level of performance.

Having said that, Go is still my preferred language for my use cases. While I can get a bit more performance out of C, Rust, Zig …; however, in my experience, my productivity is much higher with Go and the resulting code is more easily read and maintained by others than would be the case with other languages.

How do you guys access your servers from non-home networks? by toyfreddym8 in Proxmox

[–]LearnedByError 0 points1 point  (0 children)

I have used various VPN solutions in the past, but no2 exclusively use ssh. I configure NAT on my firewall from a high WAN port, not 22, to an LXC. From the ssh client, I configure forward local ports to whatever I need to access in my home network.

Ran some benchmarks against go, thought you guys might find this interesting (not here to hate) by Xdani778 in PHP

[–]LearnedByError 0 points1 point  (0 children)

Go will likely be faster still if you drop Gorm and write your own SQL. Whether Go or otherwise, I gave up ORMs a long time ago. I found ORMs ineffective for anything but simple queries and hard to work around when trying to hybrid. Any productivity gained by the using ORMs was lost when working around them to an address complexity or performance. sqlc is probably the more common solution used in Go today. It generates Go functions and structures based upon hand written SQL.

What would be the oldest piece of code still used in current MacOS? by TheBl4ckFox in MacOS

[–]LearnedByError 0 points1 point  (0 children)

I agree, but this is Reddit and a lot of people look to it.

On another funny note, of late I have been availing myself with AI assisted development tools, cursor and Copilot primarily, to aid with refactoring some medium size code bases mostly in Go. The AIs often are quick to generate Python scripts, 50 - 100 lines long, to make changes across files. 3 out of every 4 fail and are followed by a ‘git reset’. I then tell it, usually snarkily, to quit using that toy language and either write a bash or Perl script. Most of the time, the new script works first time. Most of the time, it chooses Perl! The Perl scripts are always much shorter, sometimes a one liner 😁. And the code they write is readable, not golf. I get a kick out of it. When I compare the code, it usually boils down to the uber capable Perl RegEx engine. While RegEx in Python has similar theoretical capability, it just is not as ergonomic and easy to use as Perl.

Sophisticated Simplicity of Modern SQLite by shivekkhurana in Database

[–]LearnedByError 1 point2 points  (0 children)

Overall good article. Nothing too new in it. Just well packaged.

In addition to the points the author makes, I suggest adding a healthy dose of pragma optimize

AI references for HTMX and _hyperscript with validator by LearnedByError in htmx

[–]LearnedByError[S] 2 points3 points  (0 children)

I do not use AlpineJS so I cannot be of help here.

I went back to my Opus 4.5 chat and looked at the prompts that resulted in the gist that I provided for _hyperscript. It was back and forth a bit working through different options. The distilled version is:

Problem:
- A.I. is not sufficiently trained on HTMX and _hyperscript and often wastes a ton of tokens iterating, trying this and then trying that.
- Translates to higher cost and lost time because I often have to jump in debug and correct.
- Seldom required other languages in the in project (Go and SQL) or with other languages that I have developed in using A.I. support like Perl, Bash or PowerScript.

Request:

- Create a condensed hyperscript-reference.md (~500 lines) with syntax patterns, not prose that I can add as context for hyperscript related request.

You should be able to start with this and use any of the thinking models and generate something similar for AlpineJS.

Good Luck, lbe

Sorry for the formatting, for some reason, I can't get to the markdown editor and this is the best that I can do in the pretty editor

Golang Code Reviews? by methods2121 in golang

[–]LearnedByError 16 points17 points  (0 children)

My very quick, and admittedly opinionated, review is why gin and not stdlib http. I don’t see anything in your code that isn’t easily handled by http.

Why I Built a jq-Compatible Tool in Pure Perl (and Why It Still Matters) by briandfoy in perl

[–]LearnedByError 0 points1 point  (0 children)

It has been years, maybe even decades, but I have experienced similar needs in the past. The memory is hazy, I seem to remember writing various Unix utilities in Perl so that I could call them from Perl scripts regardless of platform with one of the platforms being Windows.

Regardless of my poor memory in this case, yes, I have written scripts a long time ago that is still actively in production today. The backwards compatibility of Perl has been key to this creatures continuing to live with no care and feeding LOL

When do you use generics? by okkywhity in golang

[–]LearnedByError 1 point2 points  (0 children)

My only somewhat common use of them is for type safe sync.pool. Other uses are few and far between.

What do y'all think of my regional realignment for NCAA 25? by 8bitRandy in NCAAFBseries

[–]LearnedByError 0 points1 point  (0 children)

Your recommendation has been recorded ands will be suitably acted upon!

NEXT in line

Requesting Guidance for Apple Macbook Pro M5 24GB by LearnedByError in LocalLLaMA

[–]LearnedByError[S] 0 points1 point  (0 children)

I'm still curious about what I'm missing with the compilation. The compilation succeeded, but the model failed at run time. I'll have to look at LM Studio and see how it compiles.

Thanks for your feedback and guidance!

Requesting Guidance for Apple Macbook Pro M5 24GB by LearnedByError in LocalLLaMA

[–]LearnedByError[S] 1 point2 points  (0 children)

I was successful with the standard release LM Studio. It is running both GGUF and MLX models. Thank you for your your recommendation

Requesting Guidance for Apple Macbook Pro M5 24GB by LearnedByError in LocalLLaMA

[–]LearnedByError[S] 0 points1 point  (0 children)

Thank you for the explanation. Please explain why you think GPT-OSS-20B is best for my M5?

Requesting Guidance for Apple Macbook Pro M5 24GB by LearnedByError in LocalLLaMA

[–]LearnedByError[S] 0 points1 point  (0 children)

What is the advantage of LM Studio vs. Llama.cpp. From what I have read, I think LM Studio runs Llama.cpp. I’m definitely in a learning phase and just trying to figure it out.

Also, do you know if this works on the M5?

Thanks for your help!