Commit Graph

103 Commits

Author SHA1 Message Date
Sean Griffin
70d952a5c5 Allow beta to fail CI
Until https://github.com/rust-lang/rust/issues/43153 is fixed, our
builds are failing on beta.
2017-07-23 05:27:31 -04:00
Pascal Hertleif
ffe3221571 Don't deny warning when developing, only on CI
This changes the lint settings to only emit warnings by default. This
means that during development, you'll get to see warnings, but rustc
will continue on with compiling diesel.

When explicitly checking the code for code style (on CI in the clippy
build step, or when using `bin/check`), we supply `--deny warnings` as a
flag to `rustc` to error out on warnings.

This does not change anything when using diesel as a dependency, as
cargo automatically sets all lints to allow in that case.
2017-07-14 19:36:44 +02:00
Sean Griffin
34891a6563 Pass the right hand side to JoinTo
This is a refactoring in preparation for ad-hoc join clauses. I'm
imagining the API being roughly `lhs.inner_join(rhs.on(on_clause))`,
which will mean we will have a struct containing the rhs and the on
clause. The `JoinTo` impl for this struct will need to just destructure
it and return those pieces, so this sets up the trait changes for all
existing implementations.

I had to bump clippy as part of this change, as it hits a rustc bug that
was fixed on more recent nightlies. However, I couldn't bump to the
*latest* clippy, as recent nightlies are broken for us due to
https://github.com/rust-lang/rust/issues/43153
2017-07-13 16:05:55 -06:00
Sean Griffin
4f34e35876 Make clippy happy
Clippy has become unhappy with some of the new code. This code is *way*
overusing macros, and I need to revisit it later. There's basically no
reason for any of the macros added to exist.
2017-05-12 16:45:27 -04:00
Sean Griffin
b85e4761dc Run compile tests somewhere that isn't an allowed failure 2017-05-10 10:19:23 -04:00
Pascal Hertleif
0f0c3b2ce9 Clippy target shouldn't run compile test 2017-05-08 20:19:15 +02:00
Dorian Scheidt
df0eb52ba4 Update clippy to 0.0.126
This change updates clippy, and updates the travis nightly version to
2017-04-25.
2017-04-26 10:46:33 -05:00
Sean Griffin
1fd90492b6 Bump clippy, fix failures from running bin/test 2017-04-20 16:20:56 -04:00
Pascal Hertleif
f548fbec22 Merge tschottdorf-testing-cleanup into master 2017-03-26 20:02:33 +02:00
Dorian Scheidt
75c383cbdb Upgrade Clippy to 0.121 2017-03-22 09:49:37 -05:00
Tobias Schottdorf
6cebff56a8 Remove DATABASE_URL env var in tests 2017-03-19 09:07:52 -04:00
Tobias Schottdorf
d5c2bf41d8 Massage CI env vars for upcoming changes 2017-03-17 00:59:06 -04:00
Sean Griffin
897fac76bc Update clippy
There's a few new lints which we had to account for. One is checking for
`assert!(x == y)`. In the case of integer deserialization, I changed the
condition because I actually don't want the error message that
`assert_eq!` would give.

The other new lint is for functions which are pass by value, but only
call methods that take a reference. This was pretty much only false
positives for us. In the case of `diesel_codegen`, that lint triggered
for every `#[proc_macro_derive]` function, where we don't even control
the signature, so I've disabled it crate-wide.
2017-03-11 09:03:27 -05:00
Pascal Hertleif
d07d65f8e2 Merge pull request #751 from killercup/feature/add-sqlite-example
Add sqlite example
2017-03-04 15:12:29 +01:00
Sean Griffin
14bb72075f Run compile tests on Travis 2017-02-26 12:14:24 -05:00
Pascal Hertleif
55c927d65f Sqlite example: Add test script and CI 2017-02-23 13:23:59 +01:00
Eijebong
50469f8f7f Add mysql examples
They're the same as the postgres ones but adapted to mysql.
2017-02-18 20:53:10 +01:00
Sean Griffin
1c457f91a2 Move PG examples into a subdirectory
If we want to provide examples for backends other than PG, we'll need to
break this out further into subdirectories. I've also tried to make the
`bin/diesel` script work regardless of subdirectory so there's less
relative path nonsense.
2017-02-17 09:17:39 -05:00
Sean Griffin
16b6346c3d Add support for PG ON CONFLICT DO NOTHING
This is the first piece of #196, and somewhat lays the groundwork for
how the rest will be implemented. Getting the examples to compile and
pass was actually quite easy. The hard part was figuring out how to get
the nested cases to fail to compile.

Rather than completely upend our `InsertStatement` structure, I've
instead opted to add a marker trait which we implement in
`#[derive(Insertable)]`. It's a bit of a kludge, but it gets the job
done.
2017-02-16 13:13:55 -05:00
Sean Griffin
50559cfe2f Enable more features in docs 2017-02-12 13:54:10 -05:00
Pascal Hertleif
c16ab9cfe8 Add clippy to infer schema crate
Oops, totally forgot about that one!
2017-02-12 15:39:11 +01:00
Pascal Hertleif
88f3a43681 Now that clippy is happy, make @sgrif happy, too 2017-02-10 20:27:55 +01:00
Pascal Hertleif
e03681c5ae Add travis build step for clippy 2017-02-10 20:27:55 +01:00
Sean Griffin
229cfb2247 Enable MySQL on Travis
It is time.
2017-02-10 13:02:35 -05:00
Georg Semmler
6bb926d00f
Remove diesel_codegen_shared 2017-02-09 23:35:26 +01:00
Sean Griffin
9767a6ccfc Release v0.10.0 (The one where we work on stable)
![It's happening](http://i.imgur.com/7drHiqr.gif)

v0.10.0 drops support for Rust 1.14 and earlier, and adds support for
Rust 1.15 (ON STABLE). `diesel_codegen_syntex` has been removed, and is
no longer supported.

Additionally, this release adds initial support for the JSON data type
in PostgreSQL. There is also a new `print-schema` subcommand in Diesel
CLI which will show you the code generated by `infer_schema!()`. As
always, you can find a full list of what has changed in [the
changelog][changelog].

In addition to the Diesel core team, 7 contributors worked on this
release. A huge thank you to

- Adrian Perez de Castro
- Eric Kidd
- Georg Semmler
- Jake Goulding
- Sergio Benitez
- Severen Redwood
- Stu Black

I'd also like to thank everybody who helped this release by opening
issues, finding bugs, and asking/answering questions in our gitter room.

There were several big features that I had hoped to get done in time for
this release, but my daughter inherited my troll gene and decided to
come early. If you were hoping for MySQL support, blame Ruby. In the
mean time, here is a picture of Ruby.

![baby ruby](https://lh3.googleusercontent.com/7vUZONdvrati-NQXriSqzKQ0CHNz6KRulOSos9kJjzMNV-JI2UT6d4Kxex9fZGO-0GTlLrKHKRwiPaf2v6hCJlCU0IgK5kWd_JWz9nG61FrZfgVARZEqXOmjoXPb5CYrbTg7XlG2VEYlcm6_Lk9oviVPh7mx3gaXgVG6g-OJRHqY_gipU-Y2REPFDoJyPWZ9QoifZH1WDGSPdyYUQ1KWeTfFkxk1Z3VP1bKAyRhsDmnXvSLaWkBQ6r5CpRS2pfVMC0lPVAfPGmrjwmNw7JmFNfscQM5IY0FOqbbwJhPJvLtNb-jOgOQhz07S8HA9BBI_cWzzXXMxbGXzaPpKBYSrioMja3MkXcb1PGB8cG7ERtG_CWwpGriRlFbrj2B0OygkAu4Q6pRiQe6BojpHYp03uyRsmsVxTbQjlH3axed6tNV_IDYSd2vz15gB7yFKUF_Je3spUUdexLmybdPDR29DfD-hBBJfezy0gdzrf7dJMMXWgQ7CW6jH18uydl-iiK3_8Ha8FUuvrjcA-Dvv0nQEXqajcb_NFCpobr92fNQvDCg6UNj3o7E7bv55Oj6sOk7N7xARchy-MmAV8Tzzc1Sx-4GKHhikH5WGMb5AzYSnoNcvWr7mD4vqAF1Wn_60Huz1KCNC5m2aBbPz9G6hBcM3pMe8J5pIM4epvKFvKUKtK98=w792-h1056-no)

[changelog]: https://github.com/diesel-rs/diesel/blob/v0.10.0/CHANGELOG.md
2017-02-02 13:36:01 -05:00
Sean Griffin
d660a82fce Correctly build docs
`travis-cargo doc-upload` assumes that the `Cargo.toml` in the cwd is
the manifest for the package being documented, and it also assumes that
the docs are present in `target/doc`. There isn't really any way to make
both of those things true if we're using a workspace, so let's just move
the folder there after we document everything.
2017-02-02 11:48:33 -05:00
Sean Griffin
41369c51df Upload docs when beta passes, not stable
This should be reverted when 1.15 is released and stable is passing
again.
2017-02-02 11:44:01 -05:00
Georg Semmler
d11ed7f207 Enable tests for diesel_infer_schema crate 2017-01-30 12:23:06 +01:00
Sean Griffin
41df4a6c9f Delete diesel_codegen_syntex
Macros 1.1 is now on 1.15 beta. We will not be releasing a new version
until after that beta has launched. Dropping the syntex support from our
own code base makes life easier for development.
2017-01-09 07:34:44 -05:00
Sean Griffin
7b879fbedf Attempt to fix doc-upload to use the workspace directory 2017-01-03 14:18:42 -05:00
Boris-Chengbiao Zhou
f3ff4bee75 Use a cargo workspace 2016-12-05 17:10:53 -05:00
Sean Griffin
68d12ab6f4 Remove diesel_codegen_old, unpin nightly
This removes the dead code that was laying around as the result of the
now defunct pre-macros 1.1 implementation of codegen. I've also unpinned
the nightly version, as we should no longer break due to changes in
libsyntax. Finally, I've made sure the newly added crates are run as
part of the test suite.

The removal of `.cargo/config` and the addition of `[replace]` all over
the place is to work around
fc0e64262a.
I'm not sure what our long term plan is yet, as juggling that doesn't
sound fun to me.
2016-10-10 15:03:45 -04:00
Sean Griffin
ce31e82ef0 Implement infer_table_from_schema! as a Macros 1.1 macro
This was a bit tougher to pull out since the code responsible for
loading the schema information was pretty tightly coupled to libsyntax.
I've attempted to return as much relevant information as possible for
multiple AST frontends in an agnostic way.

This should fix the failures on master as well.
2016-10-04 16:13:19 -04:00
Sean Griffin
1dfaa8771d No seriously this should have been a global error
How the heck am I supposed to know this shit?
2016-10-03 17:42:46 -04:00
Sean Griffin
9ad730e54f How does allow failure
Also why does travis not error on unrecognized keys? That seems bad.
2016-10-03 17:08:39 -04:00
Sean Griffin
f4cbb2accd Pin the nightly version again
There was a breaking change before I could finish the 1.1 port...
2016-10-03 15:28:21 -04:00
Sean Griffin
141c9cc713 Boilerplate setup for the macros 1.1 diesel_codegen crate
This crate is currently empty. We've just pointed to it in all the
places that will eventually need to, so we can incrementally port things
over.
2016-10-03 12:11:38 -04:00
Sean Griffin
2b6423d966 Bump nightly and syntex version
This is required as part of the Macros 1.1 port. I have pinned travis to
a specific nightly, but will unpin it once the port is complete as we
should never break from a nightly again.

Close #426.
2016-10-03 10:46:25 -04:00
Pascal Hertleif
0e7c2e1fe0 Merge origin/sg-doc-types into rollup-some-prs
PR #407
2016-09-13 11:55:47 +02:00
Pascal Hertleif
ed3c350caa Travis, we don't fail on beta!
Also, cache some things. This will become more useful when cargo a
workspace is used so there is one central `target/` directory.
2016-09-09 16:58:36 +02:00
Sean Griffin
1e788ad171 Ensure that our examples continue to compile as part of our tests
Travis of course isn't following the guide, so it won't have set
`DATABASE_URL` to what I want nor will it have run `diesel setup`
2016-09-09 16:26:01 +02:00
Sean Griffin
0e9acca6de Bump nightly version
It's been 6 weeks! We're still 100% compatible with no code changes
(other than the compile test)
2016-08-18 19:21:38 -04:00
Sean Griffin
306ad26711 Better document the types module
I've seen a lot of people making the mistake of trying to put things
like `diesel::types::Timestamp` in their structs. This attempts to
better document the role of the `types` module, and documents any
`ToSql` and `FromSql` impls that are provided. I've un-inlined the pg
types module, as stating "this is a postgres specific type" in the
documentation over and over again didn't feel right. I've also made sure
that the UUID feature is turned on when generating docs.
2016-08-17 10:24:42 -04:00
Sean Griffin
36b8801bf5 Split diesel_codegen into two crates.
Having the same crate for both has caused a ton of problems with
linking. I had hoped to just use cargo features for this, but it wasn't
working out that way.

`diesel_codegen` now only targets nightly. `diesel_codegen_syntex`
handles syntex separately (and also contains the common code between the
two crates). Neither crate includes the postgres feature by default.

How to migrate
--------------

If your Cargo.toml previously looked like this:

```rust
[build-dependencies]
diesel_codegen = "0.6.0"
```

it should change to

```rust
[build-dependencies]
diesel_codegen_syntex = { version = "0.7.0", features = ["postgres"] }
```

(You'll need to change the `extern crate` line in `build.rs`)

If your Cargo.toml previously looked like this:

```rust
[dependencies]
diesel_codegen = { version = "0.6.0", default-features = false, features = ["nightly", "postgres"] }
```

it should change to

```rust
[dependencies]
diesel_codegen = { version = "0.7.0", features = ["postgres"] }
```

I've had to split out the cargo features in our test suite, since Cargo
doesn't give me a way to say "turn on the
diesel_codegen_syntex/postgres" feature only if the `with-syntex`
and `postgres` features are on, and I don't want to have to build syntex
every time I run the tests against nightly.
2016-08-01 13:43:10 -04:00
Sean Griffin
4267ca4243 Update our codebase for nightly-2016-07-07
Had to delete the test for the owned value to insert. Message involving
the types is now a note not part of the error. Unsure if this is because
it *actually* changed to a note, or if it's a quirk in compile_tests
0.2.0 (if I test for the note I need to specify *all* notes and the note
on the overflow error is enought o make me not want to do that
2016-07-18 09:51:04 -04:00
Sean Griffin
747aa09036 Bump nightly version 2016-05-11 22:49:43 -04:00
Tim Brooks
13123d620d Follow convention for new AST pointers
Old empty() method removed in
9108fb7bae
2016-04-29 16:24:26 +02:00
Sean Griffin
1af8d560c1 Fix travis build (again)
Even though my `rustc --version` says it's 2016-04-07, it appears the
error changes that we're testing against occurred on the 8th
2016-04-12 12:20:21 -06:00
Sean Griffin
848d191515 Bump to the latest nightly
We were affected by breaking changes with how struct fields are
represented. Now that I can get the tests compiling, I noticed that I
implemented the `Option` impl for specialization incorrectly.
2016-04-08 15:31:10 -04:00