DEV Community

Cover image for [VIDEO]Refactoring Endpoints with Relationships in a Swift API 🌚β™₯️🌝(Swift 5.1/Vapor 3)
✨ thetealpickle πŸ“±
✨ thetealpickle πŸ“±

Posted on β€’ Edited on

2 2

[VIDEO]Refactoring Endpoints with Relationships in a Swift API 🌚β™₯️🌝(Swift 5.1/Vapor 3)

PART 2. In this video, I walk through refactoring endpoints to access and create model relationships within a Swift-based API. The Swift API created in this video leverages the Vapor 3 framework. Models naturally interact with other models and in Vapor these model interactions are made possible by creating relationships. There are two types of relationships, one-to-many and many-to-many.

This video is PART 2 of the model relationship videos. Part 1 shows how to create relationships within the models and database.

Code for this video can be found on @thetealpickle’s GitHub at the cheese-api-swift repository πŸ‘‰πŸΎ https://github.com/thetealpickle/cheese-api-swift

Want to follow along? Get the starter code at the cheese-api-swift repository on the vapor-relationships-start branch πŸ‘‰πŸΎ https://github.com/thetealpickle/cheese-api-swift/tree/vapor-relationships-start

Follow me on social media @thetealpickle to stay connected with the Pickle universe 🌎

https://instagram.com/thetealpickle
https://twitter.com/thetealpickle
https://github.com/thetealpickle

Brought to you by JESSICA JEAN JOSEPH Β© THETEALPICKLE

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay