1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889(* Copyright (C) 2022--2024 Petter A. Urkedal <paurkedal@gmail.com>
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at your
* option) any later version, with the LGPL-3.0 Linking Exception.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* and the LGPL-3.0 Linking Exception along with this library. If not, see
* <http://www.gnu.org/licenses/> and <https://spdx.org>, respectively.
*)moduletypeDRIVER=sigtype+'afibertype(+'a,+'err)streamtypeswitchtypestdenvmoduletypeCONNECTION=Caqti_connection_sig.Swithtype'afiber:='afiberandtype('a,'err)stream:=('a,'err)streamvaldriver_info:Caqti_driver_info.tvalconnect:sw:switch->stdenv:stdenv->subst:(Caqti_template.Dialect.t->Caqti_template.Query.subst)->config:Caqti_connect_config.t->Uri.t->((moduleCONNECTION),[>Caqti_error.connect])resultfiberendmoduletypeDRIVER_FUNCTOR=functor(System:System_sig.S)->DRIVERwithtype'afiber:='aSystem.Fiber.tandtype('a,'err)stream:=('a,'err)System.Stream.tandtypeswitch:=System.Switch.tandtypestdenv:=System.stdenvletdrivers=Hashtbl.create5letregisterschemep=Hashtbl.adddriversschemepmoduletypeS=sigtype+'afibertype(+'a,+'e)streamtypeswitchtypestdenvmoduletypeCONNECTION=Caqti_connection_sig.Swithtype'afiber:='afiberandtype('a,'e)stream:=('a,'e)streammoduletypeDRIVER=DRIVERwithtype'afiber:='afiberandtype('a,'e)stream:=('a,'e)streamandtypeswitch:=switchandtypestdenv:=stdenvvalprovides_unix:boolvalfind_and_apply:string->(moduleDRIVER)optionendmoduleMake(System:System_sig.S)=structmoduletypeDRIVER=DRIVERwithtype'afiber:='aSystem.Fiber.tandtype('a,'e)stream:=('a,'e)System.Stream.tandtypeswitch:=System.Switch.tandtypestdenv:=System.stdenvmoduletypeCONNECTION=Caqti_connection_sig.Swithtype'afiber:='aSystem.Fiber.tandtype('a,'e)stream:=('a,'e)System.Stream.tletprovides_unix=falseletfind_and_applyscheme=(matchHashtbl.find_optdriversschemewith|None->None|Some(moduleF:DRIVER_FUNCTOR)->Some(moduleF(System):DRIVER))end