@jmoironI've been thinking about using starlark as a way towards a composable future for k8s cluster config for some time, and it looks like someone's actually gone and done it: https://t.co/AyH8LEjrtD Is this being used in anger? Is it successful?
@jmoironAudible "What? Oh no.." reading this. One of the great thinkers and, by all accounts, great people in computing. https://t.co/pgjjFEiFku
@jmoironThis thread is really good but really is there anything less jazz than a platform platform built almost exclusively of yaml https://t.co/ml2obirsV6
@jmoiron@copyconstruct I must be shameless, because I am dead certain I am not fashionable.
@jmoiron@kevinwardrop Co-develop access that enables devs to do their jobs in a safe and effective way. By locking everything down because you think devs are children, you're basically failing to reduce that friction. It only seems like a good solution because the costs are externalize...
@jmoironHow does this blanket "devs should not get SSH access" shit persist in this new age of observability? How much tooling is needed to overcome the artificial opacity you're introducing? What's the opportunity cost to your actual product if you develop that too early?
@jmoironeven though they are fake internet points, it still feels like some kind of validation that sqlx has passed 6000 stars on github
@jmoiron@wernerdrew Despite being a vim user for nearly 20 years nothing has ever made me want to learn hjkl navigation like the unknowable region where arrow keys supposedly live on this keyboard.
@jmoiron@wernerdrew After a 18 months hating the lack of travel and clickiness, I've grown to tolerate it. Takes me ~10 mins or so to get used to an old chiclet. I still cant find keys because they are too flat and the gaps are too small, and the keyboard is very fragile. It's poor.
@jmoiron@kaihendry Yep, but check err first :)
@jmoironCloud tech is accelerating away from the kinds of infrastructure both suitable for and relatable to hobbyists. I can't help but think we're losing something important.
@jmoiron@kaihendry @golang One of the weaknesses of relying on the Valuer/Scanner interface is you cannot define behaviours for foreign types; true for sql and for the json packages. I generally go for two simple types (T and dbT) rather than try and lump all my behaviour into one.
@jmoiron@kaihendry It's an empty slice; if the length is zero there were no records. The zero value for slices is nil, and sqlx does not allocate for you unless necessary.
@jmoiron@kaihendry It looks like this: db.NamedExec("INSERT INTO table (a, b, c) VALUES (:a, :b, :c)", []rows{ {a:1, b:2, c:3}, {a:4, b:5, c:6}, ...}) this then expands the named query section for the number of elements in the slice and does a bulk insert.
@jmoironRT @kaihendry: New video about my adventures of giving @mariadb a restful interface in @golang using @jmoiron’s handy sqlx helper. https://…
@jmoiron@calebspare @dlsspy We have a similar one for relative timestamps, eg '1h ago'. I've thought about these things a lot because I have a hard time with big numbers. I've done `kib=1024` and built from there. In my python humanize library I ended up with a compromise (https://t.c...
@jmoiron@calebspare Oh totally agree. I always over-estimate 1<<20 as 1GiB because I feel like 1<<10 is bigger than it is. I'm in favour of the new GiB/MiB/KiB as unambiguous even though it's not "how I was brought up"
@jmoiron@calebspare I find powers of 10 to be confusing. Eg, neither 10e6 nor 10_000_000 is any number of GB. Where important, I take `time.Second`'s lead and define KB/MB/GB constants to use in others. I tend to deal in multiples of pages though, which are generally 4KiB.
@jmoiron@kaihendry The reason I generally recommend select is 1. several popular driver implementations allocate the whole response greedily (or at least, used to) 2. people tend to forget to check `rows.Err()` after iterating
@jmoironBeware the runbook tarpit where everything is documented but nothing is automated.
@jmoiron@kaihendry Also the tutorial port looks good :) I'd probably switch to using `https://t.co/Uif4lG9CaP` instead of using `sqlx.StructScan` at the bottom; I think it's behaviour obvious enough to not distract from what is really more focused on REST.
@jmoiron@kaihendry There isn't; it gets really hairy when you start to have embedded types. You can use a combination of reflect and `NamedExec` to do this; I've also recently accepted a PR in HEAD that can do bulk inserts using named queries as templates.
@jmoiron@kaihendry Not aware of any :( Most of the examples/tutorials out there are pitching their own library or framework for creating these kinds of things.
@jmoironJess has put together a great list. I personally love asking people teach me what they have been learning. I learn, they learn through teaching, it reinforces humility and approachability as virtues, and signals to others that no one knows everything and that's ok. https://t.co...