 	/// - returns: The column's value
 	///
 	/// - throws: An error if the column contains an illegal value
-	public func value<T: DatabaseValueConvertible>() throws -> T {
+	public func value<T: DatabaseSerializable>() throws -> T {
 		return try row.column(index)
 	}
 }
 
-extension NSNumber: DatabaseValueConvertible {
-	public func databaseValue() -> DatabaseValue {
+extension NSNumber: DatabaseSerializable {
+	public func serialized() -> DatabaseValue {
 		switch CFNumberGetType(self as CFNumber) {
 		case .sInt8Type, .sInt16Type, .sInt32Type, .charType, .shortType, .intType,
 		     .sInt64Type, .longType, .longLongType, .cfIndexType, .nsIntegerType:


import Foundation

/// A type that may be serialized to and from a database.
///
/// For example, the implementation for `NSNull` is:
///
/// ```swift
/// extension NSNull: DatabaseValueConvertible {
///     public func databaseValue() -> DatabaseValue {
///         return DatabaseValue.null
///     }
///
///     public static func from(databaseValue value: DatabaseValue) throws -> Self {
///         switch value {
///         case .null:
///             return self.init()
///         default:
///             throw DatabaseError.dataFormatError("DatabaseValue \"\(value)\" is not null")
///         }
///     }
/// }
/// ```
public protocol DatabaseValueConvertible: ParameterBindable {
	/// Returns the value of `self` as a serializable value.
	///
	/// - returns: A serializable instance representing `self`
	func databaseValue() -> DatabaseValue

	/// Returns the value of `value` as the type of `Self`.
	///
	/// - parameter value: The serializable value to convert
	/// - returns: An instance of `Self`
	///
	/// - throws: An error if `value` contains an illegal value for `Self`
	static func from(databaseValue value: DatabaseValue) throws -> Self
}

extension DatabaseValueConvertible {
	public func bind(to stmt: SQLitePreparedStatement, parameter idx: Int32) throws {
		try databaseValue().bind(to: stmt, parameter: idx)
	}
}


	}
}

extension NSNull: DatabaseSerializable {
	public func serialized() -> DatabaseValue {
		return .null
	}

	public static func deserialize(from value: DatabaseValue) throws -> Self {
		switch value {
		case .null:
			return self.init()
