Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
rabidferret
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
by
rabidferret
11y ago
It's a bit late here, but feel free to DM me in our Gitter room and I can give you a full explanation tomorrow.
62.
▲
by
rabidferret
11y ago
The short version is its refusal to box things means that you have to have the connection, the statement, and the cursor all as local variables in the same lexical scope (you almost always want to abstract away the statement and cursor), an
63.
▲
by
rabidferret
11y ago
Diesel's selling point isn't actually the performance aspect. It's the safety and productivity.
64.
▲
by
rabidferret
11y ago
It's possible. I tried to build on rust-postgres originally, but its design basically makes it impossible to abstract over. We also have fundamentally different views on how `ToSql` should work.
65.
▲
by
rabidferret
11y ago
I'll take your word for it. I'm no gas can expert. :)
66.
▲
by
rabidferret
11y ago
Every single one of those bullet points is a primary design goal of Diesel (caveat: Our semantics generally map to PG, because they apply well to other backends and are the least nonsensical)
67.
▲
by
rabidferret
11y ago
It wasn't super clear, anyway. Fixed in https://github.com/sgrif/diesel.rs-website/pull/5 :)
68.
▲
by
rabidferret
11y ago
FWIW making sure it's easy to add extensions like this is part of the core design of Diesel. For example, this adds full text search support (it's slightly out of date) https://github.com/sgrif/diesel_full_tex
69.
▲
by
rabidferret
11y ago
I'm having Jose on The Bikeshed (bikeshed.fm) next month to compare notes!
70.
▲
by
rabidferret
11y ago
I think it's green, at least in the US. XD
71.
▲
by
rabidferret
11y ago
> The types should be able to ensure you don't have any errors even with so many "redundant" types Correct. Sorry, I should have been clearer in my last comment. The reason you'd want a separate type for insert is bec
72.
▲
by
rabidferret
11y ago
Rails 2 scopes are literally the case for composeability...
73.
▲
by
rabidferret
11y ago
This can be accomplished without procedural macros, too. ;)
74.
▲
by
rabidferret
11y ago
Short version: Because Rust's type system is a joy to use, and the reason I made Diesel was to try and push it forward in higher level contexts. I'm finding myself more productive in Rust than I am in any other language. Long vers
75.
▲
by
rabidferret
11y ago
Update yes. It's possible to use the same struct for create, too if you really want, but you'd need to wrap `id` in an `Option`. Generally we're designed for the idea that you'll have a separate struct for read, create,
76.
▲
by
rabidferret
11y ago
Short version: Our compile time guarantees allow us to omit a lot of runtime checks that you would otherwise have. Long version: http://bikeshed.fm/49 Longer version: Planning on doing a really in depth write up for the web
77.
▲
by
rabidferret
11y ago
Oh I know, I didn't think you were. Just stating a random thought I've had about the examples on the site. XD
78.
▲
by
rabidferret
11y ago
I think we're violently agreeing in a lot of ways. :) I'm curious what you mean by scale. Are you referring to performance, or code size? If you're referring to performance, you'll probably find it interesting that we ou
79.
▲
by
rabidferret
11y ago
Yeah, I'm planning on killing Arel at some point. I actually want to extract `Relation` to a gem entirely, as it's really not an adequate query builder for what we need in AR. Also random fun story about Arel not being immutable.
80.
▲
by
rabidferret
11y ago
Stored procedures are no more composeable than SQL strings are. Now it's certainly easy to say that I haven't used SQL directly. But I did spend years working that way (though of course this statement shouldn't give you much
81.
▲
by
rabidferret
11y ago
You should take a closer look at what Diesel is doing with it's query builder. We actually do attempt to support the full power of every supported backend (of course there's still holes which need to be filled), with proper type g
82.
▲
by
rabidferret
11y ago
The CLI just generates the file structure. We fill in the SQL manually as part of the guide, and then create the structs immediately after that.
83.
▲
by
rabidferret
11y ago
Thanks. The designer is taking another pass at it soon, I didn't expect to have so much traffic. I'll bump up the color on the links until then.
84.
▲
by
rabidferret
11y ago
Yeah, I've been wondering if I should note somewhere in the examples that we don't actually execute `SELECT *`, we do something more reliable. I felt like listing every column would bury the lede though.
85.
▲
by
rabidferret
11y ago
It's technically for the Republic of Serbia. I only chose it because .io was taken by a python library (which I wish I'd checked before deciding on the name) It's also a pain in the ass to register because you have to have a
86.
▲
by
rabidferret
11y ago
In that very specific example, you are right -- the benefits are pretty minimal (mostly just the deserialization). However, you're actually able to represent the relationship between those two models however you want , but still deal
87.
▲
by
rabidferret
11y ago
Mind posting a screenshot of what you're seeing? All our code samples are `font-family: monospace`
88.
▲
by
rabidferret
11y ago
I'm not sure I entirely understand the question, but we ultimately end up hooking into libpq, and right now the queries are synchronous. As we look towards features like associations, this will actually have to be true to some extent,
89.
▲
Diesel: A Safe, Extensible ORM and Query Builder for Rust
(medium.com)
31 points
by
rabidferret
11y ago
|
2 comments
90.
▲
by
rabidferret
12y ago
> You put the whole thing on Github, yet, you ask for a monthly fee? Yes, we've been doing this a lot lately. Nothing to stop you from running your own server, we're charging for our deployment. > So, this is basically like
More ›