【问题标题】:What should i do to connect and make queries to Heroku PostgreSQL from Unity/C#/vs code?我应该怎么做才能从 Unity/C#/vs 代码连接和查询 Heroku PostgreSQL?
【发布时间】:2021-08-13 12:12:10
【问题描述】:

如何使用 Unity/C# 连接到 Postgres 数据库?如何执行查询? 我在 Heroku 服务器(不是本地主机)上有 Postgres db,并且能够通过 python 和 psycopg2 使用它,但现在我使用 Unity。我拥有所有数据库凭据。只是不知道使用哪个库以及如何安装它。 我使用 Ubuntu 和 VS Code。我通过 Nuget 安装了 Nuget 和 Npgsql,但由于某种原因,它的类在 VS Code 中不可见

【问题讨论】:

  • 视情况而定。你想使用手工查询,微 ORM,ORM,...?
  • 手工制作@Klamsi
  • Npgsql 也许?
  • @Fliburt 谢谢,我想看看。但是,我还不知道如何使它与 VS Code + Ubuntu 一起工作
  • 好的,我用这个stackoverflow.com/questions/40675162/… 安装nuget和(使用nuget)npgsql

标签: c# postgresql unity3d heroku heroku-postgres


【解决方案1】:

我在 dllme.com 上找到了 Npgsql.dll。我把它放到了我在 Unity 的 Assets 中创建的 Plugins 文件夹中。这给了我一些错误: Npgsql 需要一些 dll。我跟着他们,在 dllme.com 上找到了这些 dll,并将它们也放到了 Plugins 中。并一直持续到没有错误为止。它现在可以在我的带有本地 PostgreSQL 数据库的 Ubuntu 上运行。 我在插件中有 5 个 dll:Npgsql、System.Buffers、System.Memory、System.Runtime.CompilerServices.Unsafe、System.Threading.Tasks.Extensions

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-10-24
    • 2022-11-10
    • 2016-07-13
    • 2018-12-15
    • 2020-07-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多