A sample application showcasing Vapor 4 connecting to an Oracle database using SwiftOracle package.

Overview

vapor-oracle

A sample application showcasing Vapor 4 connecting to an Oracle database using SwiftOracle package.

In this Vapor application, we create a Connection pool with multithreaded option in OCILIB, and then we inject it into Vapor request using StorageKey protocol and an extension of the Application class.
Each request thread gets its own connection from the pool (already created at the app startup.)
The connection pool can be configured with a minimum and a maximum number of connections so that each request doesn't have to establish a new database connection.

The following environment variables should be configured:

  • ORACLE_HOME=path_to_instantclient_XX, for example /Users/myuser/instantclient_19_8
  • TNS_ADMIN=path_to_a_directory_with_tnsnames.ora_file, for example, /Users/myuser/instantclient_19_8/network/admin/
  • LD_LIBRARY_PATH=path_to_instantclient_XX:path_to_OCILIB_libraries, for example: /Users/myuser/instantclient_19_8:/usr/local/lib
  • TNS_NAME=database_tns_alias_from_tnsnames.ora
  • DATABASE_USER=db_user
  • DATABASE_PASSW=db_password
  • LOG_LEVEL=debug, trace, info - see Vapor docs
You might also like...
A simple order manager, created in order to try Realm database
A simple order manager, created in order to try Realm database

Overview A simple order manager, created in order to get acquainted with the features and limitations of the local Realm database. The project is writ

A property wrapper for displaying up-to-date database content in SwiftUI views

@Query Latest release: November 25, 2021 • version 0.1.0 • CHANGELOG Requirements: iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 6.0+ • Swift 5.5+ /

BucketServer - Small API with SQLite database that saves notes for an iOS appliction called Bucket list

BucketList Server-Side Small API with SQLite database that saves notes for an iO

Synco - Synco uses Firebase's Realtime Database to synchronize data across multiple devices, in real time

Synco Synco uses Firebase's Realtime Database to synchronize a color across mult

PostgreSQL database adapter (ORM included)

PostgreSQL PostgreSQL adapter for Swift 3.0. Conforms to SQL, which provides a common interface and ORM. Documentation can be found there. Installatio

CodableCloudKit allows you to easily save and retrieve Codable objects to iCloud Database (CloudKit)
CodableCloudKit allows you to easily save and retrieve Codable objects to iCloud Database (CloudKit)

CodableCloudKit CodableCloudKit allows you to easily save and retrieve Codable objects to iCloud Database (CloudKit) Features ℹ️ Add CodableCloudKit f

A type-safe, protocol-based, pure Swift database offering effortless persistence of any object
A type-safe, protocol-based, pure Swift database offering effortless persistence of any object

There are many libraries out there that aims to help developers easily create and use SQLite databases. Unfortunately developers still have to get bogged down in simple tasks such as writing table definitions and SQL queries. SwiftyDB automatically handles everything you don't want to spend your time doing.

A Swift library to fetch the schema from a SQLite3 database.
A Swift library to fetch the schema from a SQLite3 database.

SQLite3Schema A small library to fetch the schema of a SQLite database. Contains a SQLite3 helper module for Linux. TBD. Uses just the raw SQLite API.

This Project domonstrate the latest Swift on Server to create RESTFul API's connected via Database: MongoDB NoSql

Swift is a general-purpose programming language built using a modern approach to safety & performance that make it specifically suitable for Server applications. Vapor is a web framework for Swift, allowing you to write backends, web apps APIs and HTTP servers in Swift

Comments
  • Is there any simple way to implement with Data Model instead of string ?

    Is there any simple way to implement with Data Model instead of string ?

    Suppose I have this model:

            final class UserDetail: Content {
                        var firstname: String?
                        var lastname: String?
                    
                        init (firstname: String, lastname: String ) {
                        self.firstname = firstname
                        self.lastname = lastname
                        }
                    }
    

    and response type returns :

            func index(req: Request) throws -> [UserDetail] {
            }
    

    Now is there any elegant way to respond with the date or error message ( from do catch block) ? I somehow managed to display data but how to present the error message with that return type ?

    opened by bhregmi 1
Owner
Ilia Sazonov
Software Architect, AI/ML enthusiast
Ilia Sazonov
A food delivery app using firebase as the database.

FDA-ONE Food Delivery Application is a mobile application that users can use to find the best restaurant around their location and order the meals the

Naseem Oyebola 0 Nov 28, 2021
Innova CatchKennyGame - The Image Tap Fun Game with keep your scores using Core Database

Innova_CatchKennyGame The Image Tap Fun Game with keep your scores using Core Da

Alican Kurt 0 Dec 31, 2021
Listens to changes in a PostgreSQL Database and via websockets.

realtime-swift Listens to changes in a PostgreSQL Database and via websockets. A Swift client for Supabase Realtime server. Usage Creating a Socket co

Supabase 35 Dec 1, 2022
Realm is a mobile database: a replacement for Core Data & SQLite

Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for the iOS, macOS, tvOS & wa

Realm 15.7k Jan 1, 2023
WCDB is a cross-platform database framework developed by WeChat.

WCDB 中文版本请参看这里 WCDB is an efficient, complete, easy-to-use mobile database framework used in the WeChat application. It's currently available on iOS,

Tencent 9.6k Jan 8, 2023
Sync Realm Database with CloudKit

IceCream helps you sync Realm Database with CloudKit. It works like magic! Features Realm Database Off-line First Thread Safety Reactive Programming O

Soledad 1.8k Jan 6, 2023
Movies Information DataBase (Add - Delete - Edit - Search)

MoviesInformation Movies Information DataBase (Add - Delete - Edit - Search) This Code Provide Simple Program About Movies Information This Program Ca

Mohammad Jaha 2 Sep 15, 2021
Easy direct access to your database 🎯

OHMySQL ★★ Every star is appreciated! ★★ The library supports Objective-C and Swift, iOS and macOS. You can connect to your remote MySQL database usin

Oleg 210 Dec 28, 2022
Safe and easy wrappers for common Firebase Realtime Database functions.

FirebaseHelper FirebaseHelper is a small wrapper over Firebase's realtime database, providing streamlined methods for get, set, delete, and increment

Quan Vo 15 Apr 9, 2022
A Generic CoreData Manager to accept any type of objects. Fastest way for adding a Database to your project.

QuickDB FileManager + CoreData ❗️ Save and Retrieve any thing in JUST ONE line of code ❗️ Fast usage dataBase to avoid struggling with dataBase comple

Behrad Kazemi 17 Sep 24, 2022