Commit Graph

601 Commits

Author SHA1 Message Date
Steven Fackler
47f9a660de Make cancel_query take a ref
Even though CancelData is Copy it's a bit weird for a function to take
ownership when it doesn't need to.
2015-12-06 23:38:26 -08:00
Steven Fackler
37954d1819 Update documentation to focus on direct execution and querying
It's the common case, so make things look simpler to a newcomer.
2015-12-06 23:35:28 -08:00
Steven Fackler
685557aba2 Use Connection::query in examples 2015-12-06 23:35:28 -08:00
Steven Fackler
811b0ffde9 Restructure SslMode
This is a large breaking change but makes things make way more sense
2015-12-06 23:35:28 -08:00
Steven Fackler
4d5eed832a Add query to Transaction and GenericConnection 2015-12-06 23:35:28 -08:00
Steven Fackler
afc067fb33 Remove deprecated from_sql_nullable 2015-12-06 23:35:28 -08:00
Steven Fackler
736f530ae9 Add Connection::query
Same deal as Connection::execute - a bit cheaper than preparing and
executing the statement normally.
2015-12-06 23:35:28 -08:00
Steven Fackler
58bb6c0e9a Remove rows::IntoIter
It's incompatible with Connection::query
2015-12-06 23:35:28 -08:00
Steven Fackler
458e7466b4 Remove CopyOutResponse case
You can't cncel a CopyOut.
2015-12-06 23:34:52 -08:00
Steven Fackler
19111a30bf Reorder some connection methods
Roughly rank them by which usage
2015-12-06 16:08:37 -08:00
Steven Fackler
0e6b03d06b Use a smaller crate for hex stuff
It's really overkill to pull in rustc_serialize just for hex conversions
2015-12-06 14:28:12 -08:00
Steven Fackler
4bdbcd8265 Impl NegotiateSsl for closures + rustfmt 2015-12-05 14:44:40 -08:00
Steven Fackler
3622a2e031 Release v0.10.2 2015-12-02 21:58:16 -08:00
Steven Fackler
a9effb427a Make examples consistent 2015-11-29 20:00:25 -08:00
Steven Fackler
72b96da37b Fix indentation 2015-11-28 21:22:13 -08:00
Steven Fackler
d12b01ab89 Handle copy out in quick_query 2015-11-28 21:20:52 -08:00
Steven Fackler
1aabcdbb2a Use h1s in docs 2015-11-28 21:05:13 -08:00
Steven Fackler
67bace6fc0 Rustfmt 2015-11-15 19:54:01 -08:00
Steven Fackler
6f19f6fe58 Mention what isolation level methods are doing. 2015-11-13 19:46:34 -08:00
Steven Fackler
bb358073ab Release v0.10.1 2015-11-07 16:42:13 -08:00
Steven Fackler
4078db3aa5 Doc typo fix 2015-11-01 12:06:38 -08:00
Steven Fackler
01153f784a Add a notifications iterator that waits with a timeout
Closes #105
2015-10-20 23:13:45 -07:00
Steven Fackler
c4becf6a39 Read message with timeout backend support 2015-10-20 22:37:52 -07:00
Mathieu Rheaume
f5ee8686ae To_String() cleanup for to_owned on method calls 2015-09-28 01:19:02 -04:00
Steven Fackler
8b80eba9ed Add a name accessor to Type
Also fix up some misentered type info and add a test to ensure it's
correct.
2015-09-26 22:59:40 -07:00
Steven Fackler
f551a86c0f Expose containing schema for custom types 2015-09-26 22:59:40 -07:00
Steven Fackler
be7a0f2908 Release v0.10.0 2015-09-19 11:06:51 -07:00
Steven Fackler
9d25328322 Doc fixes 2015-09-18 23:26:14 -07:00
Steven Fackler
e7d4a7e062 Drop dependency on debug builders 2015-09-18 22:55:32 -07:00
Steven Fackler
008f14b459 Move notification stuff to its own module 2015-09-18 20:55:01 -07:00
Steven Fackler
ff4248c737 Drop reexports 2015-09-18 20:21:13 -07:00
Steven Fackler
de8c882ef0 Generify connect params errors 2015-09-15 22:22:54 -07:00
Steven Fackler
50d46121cd Release v0.9.6 2015-08-28 17:01:46 -07:00
Steven Fackler
6e99874bd9 Add COPY TO STDOUT support.
Closes #51
2015-08-15 23:21:39 -07:00
Steven Fackler
63e278b9f2 Pull Statement into its own module 2015-08-15 21:39:46 -07:00
Steven Fackler
dc2f04de96 Start work on COPY TO statements 2015-08-15 20:39:13 -07:00
Steven Fackler
d958316d2b Release v0.9.5 2015-08-03 17:15:18 -07:00
Steven Fackler
b3e596b3c8 Release v0.9.4 2015-07-30 22:44:52 -07:00
Steven Fackler
a60dc808ba Ensure Connection is always Send 2015-07-22 07:41:40 -07:00
Steven Fackler
06b4681f16 Release v0.9.3 2015-07-04 16:04:53 -07:00
Steven Fackler
565d167724 Doc fixes 2015-07-04 16:03:53 -07:00
Steven Fackler
03ee761108 Add support for binary copy in execution
Binary copy in usage needs to call into `ToSql::to_sql`, which needs a
`SessionInfo`. This defines a `Read`-like trait that also passes an
instance in. A blanket impl is provided for `R: Read` so this should be
backwards compatible.
2015-07-02 23:57:54 -07:00
Steven Fackler
d146061f1c Release v0.9.2 2015-06-24 23:45:51 -07:00
Steven Fackler
defdaf81b6 Inline read_one_message
It's only called in one place
2015-06-22 23:47:28 -07:00
Steven Fackler
e62b4df7ed Optimize copy_in a bit
io::copy has to first copy onto the stack and then into the writer, but
we can just explicitly call read_to_end which knows it's dealing with a
Vec.
2015-06-12 00:44:51 -07:00
Steven Fackler
913678e9bf Properly return ioerrors to the caller in copy_in 2015-06-12 00:39:12 -07:00
Steven Fackler
53aafc36f6 Inline md5 impl
rust-crypto doesn't compile for all platforms, and this is the only
piece we need.
2015-06-09 19:55:28 -07:00
Steven Fackler
834d7c139b Move privacy trait down to others 2015-06-01 22:39:04 -07:00
Steven Fackler
6635aaf172 Doc cleanup 2015-05-31 21:48:20 -07:00
Steven Fackler
8058bd323f Make a PathBuf by value 2015-05-30 15:32:10 -07:00
Steven Fackler
ccd3c45600 Remove dead next_block_for function 2015-05-30 15:01:27 -07:00
Steven Fackler
fc0a80ed33 Release v0.9.1 2015-05-30 12:44:14 -07:00
Steven Fackler
37b36e6aa0 Implement Debug for SslMode 2015-05-30 12:42:01 -07:00
Steven Fackler
5758ccc54c Make SslMode Sync+Send 2015-05-30 12:38:42 -07:00
Steven Fackler
8e7144e21b Release v0.9.0 2015-05-29 23:22:31 -07:00
Steven Fackler
092f038288 Pull rows to their own module 2015-05-29 22:54:10 -07:00
Steven Fackler
5491a8ca10 Typo 2015-05-26 22:07:13 -07:00
Steven Fackler
f72bc4303a Hide Type constructor 2015-05-26 21:47:42 -07:00
Steven Fackler
de97f79d6f Move Slice into types 2015-05-26 21:42:34 -07:00
Steven Fackler
96d1a3af56 Drop Error::StreamDesynchronized 2015-05-25 23:27:12 -07:00
Steven Fackler
f800835456 Move error types to error module 2015-05-25 22:47:25 -07:00
Steven Fackler
417fb09b13 Un-reexport some type-related types 2015-05-25 22:09:00 -07:00
Steven Fackler
3e25dc4062 Clarify documentation 2015-05-25 20:52:06 -07:00
Steven Fackler
b75a63d384 Delete old copy in logic 2015-05-25 20:43:55 -07:00
Steven Fackler
a5c1d0ddce Don't build master docs
They aren't really all that useful.
2015-05-25 20:43:09 -07:00
Steven Fackler
9b9b82a7db Add copy_in to Statement 2015-05-25 20:40:57 -07:00
Steven Fackler
b5d9a38a59 Remove CopyInStatement
The API's awful to use.
2015-05-23 08:13:17 -07:00
Steven Fackler
35197960b2 Restructure errors
WasNull and BadResponse are gone, and Conversion was added. IoError
covers the BadResponse case and Conversion is a more general version of
WasNull.
2015-05-22 21:21:30 -07:00
Steven Fackler
81fc578ca6 Move ugh_privacy stuff to normal places
Use private traits to expose constructors internally
2015-05-22 19:51:44 -07:00
Steven Fackler
5b353aaed3 Add a SessionInfo field to ToSql and FromSql methods
Backend parameters such as timezone or server_version can be useful for
conversion methods to have access to.
2015-05-21 22:28:51 -07:00
Steven Fackler
99466da700 Update README for stable release 2015-05-17 21:04:44 -07:00
Steven Fackler
ed26ff0042 Merge branch 'breaks' 2015-05-16 20:42:25 -07:00
Steven Fackler
1b5283a3b0 Deploy master docs to master folder 2015-05-16 15:01:24 -07:00
Steven Fackler
c25f3fac94 Make capitalization consitent for options 2015-05-13 22:59:25 -07:00
Steven Fackler
26e55ff2bc Change negotiate_ssl back to taking &self
It's not clear that &mut is necessary and it makes connection calls a
bit nicer looking.
2015-05-13 15:17:37 -07:00
Steven Fackler
f957f10b19 Use a Box<NegotiateSsl> instead of a default param
Default parameter's aren't used in type inference yet, so the old setup
would result in overly verbose things like &mut SslMode::None::<NoSsl>.
In the future we can add the parameter back with a default of
Box<NegotiateSsl> to avoid forcing people to box stuff.
2015-05-13 15:14:37 -07:00
Steven Fackler
2d8f6882f3 Add NegotiateSsl bound to SslMode param 2015-05-13 14:43:39 -07:00
Steven Fackler
bf4820375d Make openssl an optional dependency 2015-05-13 14:43:39 -07:00
Steven Fackler
3c83d46ee4 Move types around and add docs 2015-05-13 14:43:03 -07:00
Steven Fackler
2a6f075ce7 De-generify StreamWrapper and NegotiateSsl
This makes NegotiateSsl object safe which is convenient for things like
r2d2.
2015-05-13 14:42:22 -07:00
Steven Fackler
be49982286 Make SSL infrastructure implementation agnostic 2015-05-13 14:42:22 -07:00
Steven Fackler
627f101c78 Remove deprecated get_transaction_isolation 2015-05-13 14:41:36 -07:00
Steven Fackler
569ff870c2 Properly escape table and column names in prepare_copy_in
We have to assemble queries by hand here which is a bit sketchy.
Manually escaping the individual identifiers to avoid introducing
injection vulernabilities is unfortunate but necessary.
2015-05-05 21:57:06 -07:00
Steven Fackler
a6c5d3014d Switch to out-of-std bufstream 2015-05-05 11:40:14 -07:00
Steven Fackler
16424dd267 Random cleanup 2015-05-02 15:55:53 -07:00
Steven Fackler
7d3b2509a4 Remove separate into_iter method 2015-05-02 13:40:06 -07:00
Steven Fackler
cd5537f803 Rename get_transaction_isolation to transaction_isolation 2015-04-24 22:10:57 -07:00
Steven Fackler
2887930c53 Fix link 2015-04-22 22:20:21 -07:00
Steven Fackler
8b43f0e3cf Add methods to access the session transaction isolation level
Closes #115
2015-04-22 22:03:09 -07:00
Steven Fackler
4b877e0a33 Cleanup 2015-04-07 23:57:22 -07:00
Steven Fackler
c848a9a87d Fix typo 2015-04-07 00:00:23 -07:00
Steven Fackler
e24d793db8 Fix build 2015-04-03 08:46:02 -07:00
Steven Fackler
a8d67a1fe4 Fix for upstream changes 2015-04-02 11:34:42 -07:00
Steven Fackler
01862817c9 Add Debug bound on ToSql and log params during stmt execution 2015-03-30 23:24:45 -07:00
Steven Fackler
8c6f72d732 Drop str_char feature 2015-03-30 22:37:14 -07:00
Steven Fackler
d6bbca93f7 Drop core feature 2015-03-30 22:30:57 -07:00
Steven Fackler
f7ae75dfce Drop unsafe_destructor 2015-03-30 22:24:47 -07:00
Steven Fackler
6c24a03030 Drop debug_builders feature 2015-03-30 21:03:31 -07:00
Steven Fackler
97ed6f02b6 Log query preparation and execution. 2015-03-30 20:18:47 -07:00
Steven Fackler
26ec854f86 Remove some use of unstable apis 2015-03-29 15:23:38 -07:00
Steven Fackler
369cb1ba9f Fix doctest 2015-03-29 15:01:34 -07:00
Steven Fackler
f680c44d8f Fix for upstream changes 2015-03-25 19:11:40 -07:00
Steven Fackler
e4b0143de9 Restore implicit prelude use 2015-03-22 11:11:22 -07:00
Steven Fackler
5e75155b7e Make time an optional dependency 2015-03-21 15:32:49 -07:00
Steven Fackler
07f380fcfb More feature updates 2015-03-20 21:00:25 -07:00
Steven Fackler
3a0e10e5c7 Fix build issues
Also remove the impls for CIDR/INET. No ipv4/ipv6 agnostic type exists
anymore in the standard library, and the old one didn't cover netmasks
anyway.
2015-03-18 20:49:14 -07:00
Steven Fackler
6a97358f58 Remove unused feature 2015-03-17 23:45:50 -07:00
Steven Fackler
3f79a189f3 Use debug builders 2015-03-14 11:11:44 -07:00
Steven Fackler
af0b6d003d Little cleanup 2015-02-28 14:05:37 -08:00
Steven Fackler
3ec5517197 Extend lifetime of LazyRows::columns return 2015-02-28 13:56:20 -08:00
Steven Fackler
dac4c4f4f1 Port to new IO 2015-02-27 20:03:25 -08:00
Steven Fackler
1767661618 Redesign ToSql and remove RawToSql 2015-02-24 21:39:29 -08:00
Steven Fackler
2380165c86 Rename NoticeHandler 2015-02-22 22:13:59 -08:00
Steven Fackler
63cd220572 Add a move iterator to Rows 2015-02-22 22:13:59 -08:00
Steven Fackler
e128096694 Fix lifetime on slice 2015-02-22 22:13:59 -08:00
Steven Fackler
176f81020a Fix debug impl 2015-02-22 22:13:59 -08:00
Steven Fackler
f102c198f1 Fix docs 2015-02-22 22:13:59 -08:00
Steven Fackler
34de2a90c3 Implement more traits for RowsIter 2015-02-22 22:13:59 -08:00
Steven Fackler
28ea91f6e5 Turn Rows into an iterable instead of iterator 2015-02-22 22:13:59 -08:00
Steven Fackler
c30bfed857 Fill out remaining postgres types 2015-02-22 22:13:59 -08:00
Steven Fackler
b34e5f31de Fix type checks 2015-02-22 22:13:59 -08:00
Steven Fackler
5f8a0b97aa Overhaul FromSql
We can now have a blanket impl for Option and remove RawFromSql
2015-02-22 22:13:59 -08:00
Steven Fackler
ef0e15b34d Change element_type to kind 2015-02-22 22:13:59 -08:00
Steven Fackler
5ec039bd5d Make time impls opt-in 2015-02-22 22:13:59 -08:00
Steven Fackler
5ed898949e Improve panic message 2015-02-22 19:00:34 -08:00
Steven Fackler
f0cfaedb01 Remove canary
Destructors are sound now, so this is no longer necessary
2015-02-22 18:37:44 -08:00
Steven Fackler
164b4a36c3 Cleanup 2015-02-22 16:46:11 -08:00
Steven Fackler
86d8f8a7b3 Use codegen instead of syntax extensions for SqlState 2015-02-22 13:39:17 -08:00
Cody P Schafer
e98d6825ab RingBuf is now VecDeque 2015-02-20 16:56:03 -05:00
Steven Fackler
ca7554092d Fix warnings 2015-02-19 09:17:48 -08:00
Steven Fackler
3a9beb791d Add Row::get_bytes
Useful for things like postgres_large_object to avoid some allocation
2015-02-15 23:24:09 -08:00
Steven Fackler
7db4cb70b8 Store parameters and add accessor 2015-02-15 20:22:56 -08:00
Steven Fackler
a0cca5fa77 Add a Slice adapter type
Until impl specialization exists, we can't define this implementaion
directly on &[T] because of the existing implementation for &[u8].

Closes #92
2015-02-12 22:52:55 -08:00
Steven Fackler
35f4fea595 Fix for upstream changes 2015-02-11 11:36:28 -08:00
Steven Fackler
561d7be79c Move docs to this repo and auto build in travis 2015-02-07 20:33:44 -08:00
Steven Fackler
599a84ac91 Shuffle unknown type boxing a bit 2015-02-06 09:03:49 -08:00
Steven Fackler
94d0411d68 Make DbError constructors actually private 2015-02-06 09:03:49 -08:00
Steven Fackler
cae12218ab Encapsulate information about unknown types 2015-02-06 09:03:49 -08:00
Steven Fackler
f96664e63e Rename ResultDescription to Column and encapsulate 2015-02-06 09:03:49 -08:00
Steven Fackler
7cfde75dce Encapsulate DbError 2015-02-06 09:03:49 -08:00
Steven Fackler
7fc495738d Fix docs 2015-02-06 09:03:49 -08:00
Steven Fackler
173075bae1 Remove Error::WrongParamCount 2015-02-06 09:03:49 -08:00
Steven Fackler
cd1d9b9e3f Remove deprecated methods 2015-02-06 09:03:49 -08:00
Steven Fackler
e8d372d555 Make execute return a u64 instead of usize 2015-02-06 09:03:48 -08:00
Steven Fackler
dec549b9ca Clean up panic checks a bit 2015-02-06 09:03:48 -08:00
Steven Fackler
7101cab178 Remove WrongConnection and WrongTransaction Errors
These only occur during contract violations, so panicing is recommended
by the erorr handling RFC.
2015-02-06 09:03:48 -08:00
Steven Fackler
d35124e214 Make next_block_for return an option 2015-02-06 09:03:48 -08:00
Steven Fackler
4a93618293 Make Debug impls less recursive 2015-02-05 23:01:42 -08:00
Steven Fackler
e41870ade3 Display the statement cache size in Conn Debug impl 2015-02-05 22:57:26 -08:00
Steven Fackler
9d5cd8f3d1 Sort extern crates 2015-02-04 20:39:30 -08:00