 	/// Retrieve the value of the column
 	///
 	/// - returns: The column's value
-	public func column<T: DatabaseValueConvertible>(_ index: Int) -> T? {
-		return T.fromDatabaseValue(column(index))
+	/// - throws: An error if the value contains an illegal value
+	public func column<T: DatabaseValueConvertible>(_ index: Int) throws -> T? {
+		return try T.fromDatabaseValue(column(index))
 	}
 }
 

public protocol DatabaseValueConvertible {
	/// Convert `self` to a database value
	///
	/// - returns: A `DatabaseValue` representing `self`
	func toDatabaseValue() -> DatabaseValue

	/// Convert a database value to the type of `Self`
	///
	/// - parameter value: The database value to convert
	/// - returns: An instance of `Self` or `nil`
	static func fromDatabaseValue(_ value: DatabaseValue) -> Self?
}

/// Parameter binding for convertible types
extension Statement {
	/// Bind a value to a statement parameter
	///
	/// Parameter indexes are 1-based.  The leftmost parameter in a statement has index 1.
	/// - parameter value: The desired value of the parameter

		try bind(value: value.toDatabaseValue(), toParameter: name)
	}

	/// Bind a sequence of values to SQL parameters
	///
	/// - parameter values: A sequence of `DatabaseValueConvertible` instances to bind
	/// - throws: `DatabaseError`
	public func bind<S: Sequence, T: DatabaseValueConvertible>(_ values: S) throws where S.Iterator.Element == T {
		var index = 1
		for value in values {
			try bind(value: value.toDatabaseValue(), toParameter: index)
			index += 1
		}
	}

	/// Bind a sequence of key/value pairs to named SQL parameters
	///
	/// - parameter values: A sequence of `DatabaseValueConvertible` instances to bind
	/// - throws: `DatabaseError`
	public func bind<S: Sequence, T: DatabaseValueConvertible>(_ values: S) throws where S.Iterator.Element == (String, T) {
		for (key, value) in values {
			try bind(value: value.toDatabaseValue(), toParameter: key)
		}
	}

