Class
Users
public final class Users: Model
Representation of Users table.
Relationships
Conforms To
Model
Initializers
init()
public init()
init(id:username:email:bio:image:hash:salt:)
public init(id: Int?, username: String, email: String, bio: String = "", image: String = "", hash: String, salt: String)
Default initializer.
Parameters
Name | Type | Description |
---|---|---|
id | Int? |
See |
username | String |
See |
String |
See |
|
bio | String |
See |
image | String |
See |
hash | String |
See |
salt | String |
See |
Properties
schema
public static let schema = "Users"
id
@ID(custom: .id, generatedBy: .database)
public var id: Int?
A Identifier.
It is assumed that the value is entered on the Database side. The application does not change this value usually.
Methods
create(on:)
public static func create(on database: MySQLDatabase) -> EventLoopFuture<Void>
Execute SQL statement for table creation.
In general, you should use features provided by the following standards: https://docs.vapor.codes/3.0/fluent/models/#create
Parameters
Name | Type | Description |
---|---|---|
connection | A established connection. |