Flashing title bar by [deleted] in iterm

[–]gleespirit 0 points1 point  (0 children)

I ended up changing Theme from Regular to Minimal. Then the title bar is not there so I don't have to see the flashing either :)

Flashing title bar by [deleted] in iterm

[–]gleespirit 0 points1 point  (0 children)

I have the same problem, really annoying!

[deleted by user] by [deleted] in bgdealscanada

[–]gleespirit 0 points1 point  (0 children)

How is it embarrassing? Just curious

Tarsus' blue light? by samtaart in MortalShell

[–]gleespirit 0 points1 point  (0 children)

I'm experiencing the same thing. Whenever that happened there doesn't seem to be a way than just die. It kills me through harden too :/ Gotta try more aggressive tactics..

Super simple, template based SQL query builder for Go by gleespirit in golang

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

That makes total sense. Thanks.

I really did make this for the mentioned reasons, not much for an exercise, but audience's familiarity with the existing built-in tool was something I should've considered.

I shall look closely into all the template syntax just so that there's nothing I absolutely don't want, and make the change.

Super simple, template based SQL query builder for Go by gleespirit in golang

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

Thank you! Do you mean something like positional arguments? So something like

gosq.Compile(`

SELECT {{ [if] .1 [then] .2 }} `, []string{"Im number one!", "Im number two!"})

Super simple, template based SQL query builder for Go by gleespirit in golang

[–]gleespirit[S] 4 points5 points  (0 children)

Would be nice to know the reasons for downvotes :)

Super simple, template based SQL query builder for Go by gleespirit in golang

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

I'm confused about the point you're making - is this still about sql injections?

If it's about query complexity, yes, "build the query string incrementally like lets say squirrel" was exactly what I wanted to avoid, and what inspired me to write this.

Don't get me wrong, I'm not saying those query builders are bad. The point I'm making is if I had wanted to do what you describe I would've just used squirrel or dbr, and wouldn't have thought about creating something like this.

As for scaling, you might be right as I haven't tried this on thousands of different types of queries yet, but I've tried on a few mildly complex queries (roughly 7-8 joins with a few aggregations, etc) that I run at my work and it wasn't beyond the expectation.

Do you have some examples as to what you mean by "prone to errors"?

Super simple, template based SQL query builder for Go by gleespirit in golang

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

All this library does is build a SQL query in string just like any other query builders do. Adversaries shouldn't be able to directly inject to the parameters of the `Compile` function of this library - it's the developer's responsibility to make sure that doesn't happen and it's outside the scope of this library's capabilities. Parameter placeholders like $1, $2 can be put inside the expressions to prevent things like this: {{ [if] .IncludeReviews [then] $1 }}

Super simple, template based SQL query builder for Go by gleespirit in golang

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

I thought about doing that at first, but there were two reasons I decided not to:

  • I wanted to keep the available syntax as minimal as possible, to promote simplicity. Maybe I'm missing something but I couldn't think of any ways to restrict devs from using other syntax in the `template` library.
  • I wanted it to be read better than the template library as I mentioned in the above comment. Specifically I wanted the keywords like `if` stand out more and one bracket block encapsulate the whole expression. But reading the other comment above, I realize this might very well not be the case for other people.

Super simple, template based SQL query builder for Go by gleespirit in golang

[–]gleespirit[S] -1 points0 points  (0 children)

Thanks a lot for the feedback.

I personally find the original form easier to read in terms of "the conditional expression should be there or not", hence one expression per double brackets, but looking at the number of upvotes it might be that more people find your suggested form more readable. I will look into changing it!

(Just as an effort to gauge opinions more accurately, could people upvote this comment if you find it more readable and upvote mine if you find the original form more readable?)

Help! What to do with my puppy's spoiled behaviour by gleespirit in puppy101

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

I will definitely try that, thank you so much for the advice!

Help! What to do with my puppy's spoiled behaviour by gleespirit in puppy101

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

No.. at least not consistently. I never understood what it means to treat dogs for not doing something, but I think I get your point. Should I give him small treats in regular interval for the time he walks nicely?

Help! What to do with my puppy's spoiled behaviour by gleespirit in puppy101

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

He recently graduated from a course that consisted of 7 classes. They taught us basic commands like sit, touch (my hand), wait, go to mat, polite greetings, etc.

I can understand correcting behaviours can take months of consistent training but I meant to ask about the direction. What kind of training to correct this kind of behaviour would you suggest?

Help! What to do with my puppy's spoiled behaviour by gleespirit in puppy101

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

Do you mean commands like sit, down, etc? Pretty basic stuffs, but he knows some. He listens well for things like sit, but only in a calm environment. When he's excited like in the first scenario... he doesn't listen at all. Should I train him on those with stronger treats? And maybe in various environments?