Postgres connected vapor

vapor
func create(req: Request) throws -> EventLoopFuture<Room> {
let room = try req.content.decode(Room.self)
return room.create(on: req.db).map { room }
}
server: id of relation violates not-null constraint (ExecConstraints)
final class Room: Codable, Model, Content {
static let schema: String = "rooms"
@ID(custom: "id")
var id: Int?
........
func prepare(on database: Database) -> EventLoopFuture<Void> {
return database.schema("rooms")
.id()
@ID(key: .id)     
var id: UUID?

--

--

--

Depths of ocean could not swallow me.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Jitsi@scale: Day ① — “Everything the net touches is our kingdom”

GraphQL & Distributed SQL Tips and Tricks — Aug 10, 2020

How to install Jupyter Notebook/Lab without Anaconda?

Introduction to Firebase

SAT Encoding: An Introduction

Kubernetes The Hard Way on Azure notes from the field

What is HTML, where is it used and how to learn

html

Introduction to the Basics of Python 3-Part 2

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sis Ccr

Sis Ccr

Depths of ocean could not swallow me.

More from Medium

iOS Lightweight Hooking Library

[Measurement APIs] How to create custom Units and Dimensions (Part 2)

iOS Unit Tests and Asynchronous Calls

Mock server inside native iOS tests