Commit Graph

63 Commits

Author SHA1 Message Date
Pascal Hertleif
02cbb229d9 Update API documentation links
We now point to docs.rs for the documentation of the latest release
instead of docs.diesel.rs which contains documentation rendered for the
master branch.

The readme now contains both links you might be reading it in context of
Diesel's Github repo page or on crates.io. I also changed the
diesel_codegen documentation entry to point to the guides listing page,
as there are multiple guides (some just drafts right now) that talk
about the derives.

[ci skip]
2017-11-27 11:41:04 +01:00
Maxime “pep” Buquet
af990698c1 Convert other misc links to https 2017-11-04 01:18:59 +00:00
Maxime “pep” Buquet
d49b9189ef Convert diesel.rs links to https.
sed -i 's,http://\(docs\.\)\?diesel\.rs,https://\1diesel\.rs,g' **/*.md **/*.toml
2017-11-04 01:12:29 +00:00
Lauri Apple
96b5f46786 Update README.md
I missed a period!
2017-09-20 11:24:23 +02:00
Lauri Apple
510bc30437 Update README.md
Hi! I don't have bandwidth for full doc sets, so I just edited the README + Contributing.md—making small changes. Some suggestions for the README:

Take a look at this product analysis template (https://github.com/zalando/zalando-howto-open-source/blob/master/producttemplate.md) and use it to create an Intro section in your README that answers these questions:
— what inspired/prompted you to make this?
— do you have metrics/other evidence showing its usefulness?
— any user testimonials showing its value?
— what is this like/not like; or is it the only one of its kind? 

Thanks for submitting your project. :)
2017-09-16 13:45:16 +02:00
Sean Griffin
b1660cf4ed [ci skip] Fix Appveyor badge
I have no clue how that link got messed up
2017-02-21 10:50:33 -05:00
Sean Griffin
eb29d30de1 [ci skip] Add Appveyor status to README 2017-02-21 10:48:34 -05:00
Sean Griffin
964be8a458 Add a crates.io badge to the README
I rather dislike having a bunch of unneccessary badges with this sort of
static info, but I seem to be in the minority on this one.
2017-01-04 09:57:43 -05:00
Sean Griffin
98cdb33ff3 Fix travis/gitter links 2016-04-20 09:54:53 -06:00
Sean Griffin
c30a23cfc1 Replace sgrif/diesel with diesel-rs/diesel in all links 2016-04-20 09:49:24 -06:00
Sean Griffin
2893bfade7 Newline before link in README 2016-02-11 10:07:12 -07:00
Sean Griffin
207f29f09d Link to the website in the README 2016-02-11 09:50:38 -07:00
Sean Griffin
968b84431a Add the logo to the README 2016-02-11 09:49:55 -07:00
Sean Griffin
44e40bc90a Release version 0.5.0
This is by far our biggest release yet, including 162 commits by 9
contributors. You can view the full changelog at
https://github.com/sgrif/diesel/blob/v0.5.0/CHANGELOG.md

To coincide with this release, we've launched a new website. Check it
out at http://diesel.rs -- We've also published a new Getting Started
guide.

By far the biggest feature of this release is support for SQLite3 as a
backend. If you'd like to try it out, add `features = ["sqlite"]` to
`diesel` and `diesel_codgen` in your Cargo.toml. PostgreSQL is still
included by default. To remove it, add `default-features = false`.

Additionally, this release adds support for the various types from the
`chrono` crate. Add `features = ["chrono"]` to enable it.

Some of the more minor features include the ability to opt into the
0.2.0 behavior for updates (treating `None` as `NULL` instead of
skipping the field), as well as support for the `sum` and `avg`
functions.

Unfortunately, there were some breaking changes in this release that are
likely to have a broad impact. `diesel::Connection` is now
`diesel::pg::PgConnection`. `load` and `get_results` now return a `Vec`
instead of an `Iterator`. `Queriable` has been renamed to `Queryable`.

This release was a huge group effort to make happen, and we hope you
enjoy it. Happy Dieseling!

Thank you to Diesel core team, and the contributors to this release:

@oursonguimauve
@robertmaloney
@tamird
@tessgriffin
@weiznich
2016-02-05 14:47:21 -07:00
Sean Griffin
2697f37bed Link to the getting started guide on the website
We still need to have the designer do another pass on that page, but the
content there is *much* more up to date than what we have on the README
right now, and I don't care if the formatting is a bit off for the time
being.
2016-02-04 07:41:13 -07:00
Tamir Duberstein
c28622a802 Remove some uses of unwrap() 2016-01-30 12:26:34 -05:00
Sean Griffin
f94321641c Note that the README is for master, not the latest release 2016-01-29 08:54:51 -07:00
Sam Phippen
f27f6303b5 Link to the code of conduct from the README 2016-01-28 15:20:16 +00:00
Matt Casper
211931717f Merge pull request #112 from mcasper/readme_tweaks
Clean up old stuff in the README
2016-01-18 10:05:03 -08:00
Matt Casper
1fe6ab8ad6 Clean up old stuff in the README 2016-01-18 09:20:08 -08:00
Sean Griffin
20adfbb54f Add gitter link to the README
Fixes #111
2016-01-18 10:10:55 -07:00
Mike Piccolo
805444699f Rename Queriable to Queryable 2016-01-15 14:39:02 -08:00
Sean Griffin
963222f557 Move our types around, add a prelude module.
This might move around a little bit more, but I want to just be able to
write `diesel::update`, the `use` statements for those functions are
really common and quite noisy. This means that we need to stop
recommending glob importing the top level, and give something to be glob
imported.

I *think* I want to re-export the prelude from the top level, but I'm
not 100% certain. An alternative would be to export some of our structs
from the prelude as well.

Fixes #93
2016-01-13 11:22:54 -07:00
Sean Griffin
5c8ab5ea64 Relicense under dual MIT/Apache-2.0
Fixes #82
2016-01-11 09:46:33 -07:00
Sean Griffin
39197e4cce Release Diesel 0.4.0
In addition to numerous bug fixes, the headline feature of this release
is the addition of Diesel CLI, and the `migrations` module to help
automatically manage your schema. See the CHANGELOG for full details.
https://github.com/sgrif/diesel/blob/master/CHANGELOG.md#040-2016-01-08
2016-01-08 15:36:50 -07:00
Sean Griffin
edbb04ab8e Add a quick migrations guide to the README
This should be expanded further, but I want to scrap most of the README
and do a better guide (e.g. I don't think we need to mention `table!`,
at least not before mentioning `infer_schema!()`)

/cc @mfpiccolo
2016-01-08 14:42:36 -07:00
Mike Piccolo
6b93d63a7a Set variable in delete example 2015-12-28 16:41:10 -08:00
Sean Griffin
272d63db6f Add infer_schema!, document both this and the table specific form
`infer_schema_from_table!` calls `table!` for you automatically for a
single table. `infer_schema!` loads the table names from the database
and calls `infer_schema_from_table!` for you automatically.

Fixes #40.
2015-12-04 17:23:05 -07:00
Dimiter Petrov
1c0cb71b2f Avoid unwrap() in the documentation 2015-12-03 21:58:01 +01:00
Sean Griffin
52a2cab6ea Release 0.2
Yes, one day later. There were a couple of breaking changes that became
clearly needed. I didn't expect this to get as much traffic as it has,
so I'd like to get these changes made before too many people rely on the
old behavior. See the CHANGELOG for specific API changes.
2015-11-30 10:43:41 -07:00
Sean Griffin
caea99a34e Change insert to mirror update and delete
This was a wart from the earliest days of implementation. It's
inconsistent, and feels weird in place with the rest of the commands.

I felt weird about the `Copy` bound on `InsertStatement`, but it ends up
being required and makes sense when you consider that we'll always be
passed references. However, it can potentially lead to some confusing
error messages.

The old methods on `Connection` are deprecated, and will be removed in
the next release.

Fixes #30.
2015-11-30 10:27:46 -07:00
Sean Griffin
3cb4ad2835 Add get_result and get_results to SQL commands
These are intended to be used in favor of `query_one` and `query_all`,
which are now hidden from the public API. I originally was going to name
these `run` and `run_all`, but I didn't like the name `run_all`, nor the
fact that `run` and `execute` are synonyms ("Do I call `memcpy` or
`memmov` here?")

Fixes #29
2015-11-30 09:26:05 -07:00
Sean Griffin
7c6d388bc8 Replace Connection#execute_returning_count with command.execute
Using `update` and `delete` was previously quite annoying to write. This
makes the API feel much more fluid, and reads better if you're not
actually using the count. Since `insert` is coming in this release as
well, this will make things more useable.
2015-11-30 09:26:05 -07:00
Sean Griffin
e38d199e02 Add a call to action to the README
I want to make sure it's clear that I don't think we're done yet, and
I'm still looking for feedback. I think this is a good place to do that.
2015-11-29 21:06:32 -07:00
Sean Griffin
b5e04a7321 Link to the getting started guide for the released version on crates.io
Some of the code in the README has been updated for
cbe24710f6,
and is incorrect on 0.1.0. Some of the documentation examples are
incorrrect still, but I'm going to push 0.2.0 tomorrow, and I'm
intending to keep the API relatively stable, so hopefully this won't be
a problem that needs solving longer term.
2015-11-29 18:25:47 -07:00
Sean Griffin
d0842a3f53 Fix incorrect examples in the README
Many of these were broken by
cbe24710f6.

As it turned out "this may change in the future" was an accurate
prediction. As an aside, I don't like that the README becomes incorrect
on the released version. I should come up with a solution for that.
2015-11-29 18:08:52 -07:00
Mathieu Rochette
6e513f2ebf fix typo in README.md 2015-11-29 23:17:42 +01:00
Sean Griffin
f081727eaf Get the README and root documentation a bit more ready for primetime
We're at the point where this can be judged for what it is. We don't
need the design explanation and "please help try it out" bit.

I also want to make sure that anyone who clicks documentation from
crates.io has an easy way to reach the getting started guide.
2015-11-29 13:35:45 -07:00
Sean Griffin
450dd8c16c We are documented and semi stable now 2015-11-29 11:07:08 -07:00
Sean Griffin
c8127d408f YAQB is now Diesel
I really hope blame is smart enough to be able to go through this
commit.
2015-11-29 10:43:57 -07:00
Sean Griffin
8d29233bbb Document the update_statement module 2015-11-29 09:34:10 -07:00
Sean Griffin
be4f4880b0 Inline the Insertable trait into root, document it
I don't want to expose the `persistable` namespace, as I might change it
in the future. `Insertable` is the only thing in there that matters.
2015-11-29 08:38:00 -07:00
Sean Griffin
1ba9053c61 Get the build working on stable and beta
This introduces syntex as a dependency on stable, which will pre-process
the appropriate files for annotations. We need to document this process
somewhere.

Fixes #15
2015-11-28 14:23:04 -07:00
Sean Griffin
0ba111003f Link to the docs in the readme 2015-11-28 13:08:51 -07:00
Sean Griffin
12e9f73079 Generate a save_changes method on structs with a primary key
I'm starting to see the lines where I think I'll want to break out
another library, where one is responsible for query building and
database interactions, with the other responsible for removing common
boilerplate.

I think this method might be too broad, as it'll introduce problems if
you have a race condition of two things trying to set `updated_at`. I'm
also not sure if it'll be a problem though, since if you have forms or
an API, you'll have a struct that doesn't have timestamps on it.

There might be another helper function in there, called `update_with`
which uses another struct to update the fields. That said, I'm not sure
why you'd build the struct to represent the whole record with bad data.
Maybe this whole mutable pointer thing is actually just not helpful. I
need to think about it, and try using this API a bit. Potential
additions/changes

`update_with`:

```rust
impl User {
    pub fn update_with<T>(&mut self, connection: &Connection, changes: T)
        -> QueryResult<()> where
            T: AsChangeset,
            T::Changeset: Changeset<Target=users>,
    {
        *self = {
            let command = update(users.filter(id.eq(self.id))).set(&changes);
            try!(connection.query_one(command)).unwrap()
        }
    }
}
```

`save_changes` returns new model:

```rust
impl EditProfileForm {
    pub fn save_changes<T>(&self, connection: &Connection) -> T where
        T: Queriable<UpdateStatement<users, Self::Changeset>::SqlType>,
    {
          let command = update(users.filter(id.eq(self.id))).set(&self);
          try!(connection.query_one(command)).unwrap()
    }
}
```
2015-11-28 10:07:06 -07:00
Sean Griffin
c4b8a340ae Replace the changeset! macro with an annotation
I've opted to never generate code that changes the primary key of a
record. If you *really* want to do that in some scenario, you can do it
manually. This code will need to be updated at some point to deal with
composite primary keys.

Fixes #12.
2015-11-28 09:40:48 -07:00
Sean Griffin
f30e0648ad Rename Result to QueryResult
I've found that having this name conflict with Prelude has been annoying
in practice, which is why I was referring to it as `DbResult` in the
docs. Since I'm already using that name for another type (and this has
resulted in confusion), I went with `QueryResult` for this.

Fixes #21.
2015-11-28 08:39:16 -07:00
Sean Griffin
1a58b37e77 Merge pull request #19 from mikeastock/readme_code_examples
Consistently use connection vs conn
2015-11-28 08:13:47 -07:00
Michael Stock
660044043d Consistently use connection vs conn
Some of the code examples had the argument named as conn but were using
connection
2015-11-27 20:38:29 -08:00
Matt Casper
8f14981953 Update getting started docs for clarity and grammar 2015-11-27 18:59:29 -08:00