使用Direct to SwiftUI的DVDRental示例中的不变数据库连接屏幕

问题描述 投票:0回答:1

我已加载完成的DVDRental演示应用程序与

        git clone -b branches/10-customized \
           https://github.com/DirectToSwift/DVDRental.git 

(请参阅http://www.alwaysrightinstitute.com/directtoswiftui/),并还原了演示数据库。目前,我正在尝试按照http://www.alwaysrightinstitute.com/directtoswiftui/https://github.com/DirectToSwift/DVDRental中的自述文件中的说明执行该应用程序。这意味着我已经相应地命名了数据库并构建了应用程序。但是,该应用程序仍保留在启动屏幕上,显示“正在连接数据库”消息。没有错误,也没有任何输出。调试也没有显示问题。逐步检查似乎无休止地执行libsystem_kernel.dylib->以

开头的CoreFoundation循环
libsystem_kernel.dylib`mach_msg_trap:
    0x7fff523b6250 <+0>:  movq   %rcx, %r10
    0x7fff523b6253 <+3>:  movl   $0x100001f, %eax          ; imm = 0x100001F 
    0x7fff523b6258 <+8>:  syscall 
->  0x7fff523b625a <+10>: retq   
    0x7fff523b625b <+11>: nop    

然后没有任何反应。

simulation pic: the permanent state

我还试图将DatabaseConfig.swift中的let adaptor = PostgreSQLAdaptor(database: "dvdrental")行更改为let adaptor = PostgreSQLAdaptor(host: "localhost", database: "dvdrental" , user: "test", password: "123456", useSSL : true)。但是,它并没有解决任何问题。

使用:

Xcode 11.3.1;斯威夫特5; iOS 13; Postgres.app版本2.3.3e; PostgreSQL 12

任何想法可能有什么问题吗?

更新:数据库没有问题。我可以通过psql,诸如postico或navicat之类的客户端进行连接,也可以使用PostgresClientKit与自己的应用程序进行连接。因此,我很确定问题出在演示应用程序的某个地方

xcode postgresql database-connection swiftui
1个回答
0
投票

也许usessl:是吗?不记得是否支持ssl,我想不

© www.soinside.com 2019 - 2024. All rights reserved.