91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

前端技術之:Prisma Demo服務部署過程記錄

發布時間:2020-03-04 18:31:47 來源:網絡 閱讀:226 作者:popgis 欄目:web開發

安裝前提條件:

1、已經安裝了docker運行環境

2、以下命令執行記錄發生在MackBook環境

3、已經安裝了PostgreSQL(我使用的是11版本)

4、Node開發運行環境可以正常工作


首先需要通過Node包管理器安裝Prisma工具:

npm install -g prisma


然后,創建并初始化prisma項目:

prisma init prisma-study

? Set up a new Prisma server or deploy to an existing server? (Use arrow keys)

????????????????????????

??You can set up Prisma for local development (based on docker-compose)

? Use existing database??????Connect to existing database

??Create new database????????Set up a local database using Docker

????????????????????????

??Or deploy to an existing Prisma server:

??Demo server????????????????Hosted demo environment incl. database (requires login)

??Use other server???????????Manually provide endpoint of a running Prisma server


選擇使用已存在的數據庫(Use existing database)后,回車確認選擇。


? Set up a new Prisma server or deploy to an existing server? Use existing database

? What kind of database do you want to deploy to?

??MySQL?????????????MySQL compliant databases like MySQL or MariaDB

? PostgreSQL????????PostgreSQL database


移動上下箭頭鍵盤按鍵,選擇PostgreSQL后,再次回車確認選擇。


? Set up a new Prisma server or deploy to an existing server? Use existing database

? What kind of database do you want to deploy to? PostgreSQL

? Does your database contain existing data? (Use arrow keys)

? No

??Yes (experimental - Prisma migrations not yet supported)

??

Warning: Introspecting databases with existing data is currently an experimental feature. If you find any issues, please report them here: https://github.co

m/prisma/prisma/issues


提示是否在選擇的數據庫中包含已存在數據。因為是一個新庫,所以默認選擇No,然后回車確認。

? Set up a new Prisma server or deploy to an existing server? Use existing database

? What kind of database do you want to deploy to? PostgreSQL

? Does your database contain existing data? No

? Enter database host (localhost)


輸入數據庫的主機地址(注意,因為prisma會運行在docker中,所以,這兒需要配置宿主機IP,在類Linux系統上可以通過ifconfig命令來獲取IP)。

? Set up a new Prisma server or deploy to an existing server? Use existing database

? What kind of database do you want to deploy to? PostgreSQL

? Does your database contain existing data? No

? Enter database host 10.111.152.242

? Enter database port (5432)


回車確認使用默認的Postgres數據庫的端口。

? Set up a new Prisma server or deploy to an existing server? Use existing database

? What kind of database do you want to deploy to? PostgreSQL

? Does your database contain existing data? No

? Enter database host 10.xxx.xxx.xxx(此處為你的docker宿主機IP)

? Enter database port 5432

? Enter database user


輸入數據庫的用戶名后回車確認。

? Set up a new Prisma server or deploy to an existing server? Use existing database

? What kind of database do you want to deploy to? PostgreSQL

? Does your database contain existing data? No

? Enter database host 10.xxx.xxx.xxx(此處為你的docker宿主機IP)

? Enter database port 5432

? Enter database user postgres

? Enter database password

輸入數據庫用戶對應的密碼后回車確認。

? Set up a new Prisma server or deploy to an existing server? Use existing database

? What kind of database do you want to deploy to? PostgreSQL

? Does your database contain existing data? No

? Enter database host 10.xxx.xxx.xxx(此處為你的docker宿主機IP)

? Enter database port 5432

? Enter database user postgres

? Enter database password study

? Enter database name


輸入使用的數據庫名稱后回車。

? Set up a new Prisma server or deploy to an existing server? Use existing database

? What kind of database do you want to deploy to? PostgreSQL

? Does your database contain existing data? No

? Enter database host 10.xxx.xxx.xxx(此處為你的docker宿主機IP)

? Enter database port 5432

? Enter database user postgres

? Enter database password study

? Enter database name study

? Use SSL? (Y/n)


提示是否使用安全的網絡協議,這里選擇不使用(輸入n后回車)。

? Set up a new Prisma server or deploy to an existing server? Use existing database

? What kind of database do you want to deploy to? PostgreSQL

? Does your database contain existing data? No

? Enter database host 10.xxx.xxx.xxx(此處為你的docker宿主機IP)

? Enter database port 5432

? Enter database user postgres

? Enter database password study

? Enter database name study

? Use SSL? No

Connecting to database 18ms

? Select the programming language for the generated Prisma client

??Prisma TypeScript Client

??Prisma Flow Client

? Prisma JavaScript Client

??Prisma Go Client

??Don't generate

這里選擇產生JavaScript客戶端腳本(Prisma JavaScript Client)。

? Set up a new Prisma server or deploy to an existing server? Use existing database

? What kind of database do you want to deploy to? PostgreSQL

? Does your database contain existing data? No

? Enter database host 10.xxx.xxx.xxx(此處為你的docker宿主機IP)

? Enter database port 5432

? Enter database user postgres

? Enter database password study

? Enter database name study

? Use SSL? No

Connecting to database 18ms

? Select the programming language for the generated Prisma client Prisma JavaScript Client

Created 3 new files:??????????????????????????????????????????????????????????????????????????

??prisma.yml??????????Prisma service definition

??datamodel.prisma????GraphQL SDL-based datamodel (foundation for database)

??docker-compose.yml??Docker configuration file

Next steps:

??1. Open folder: cd prisma-study

??2. Start your Prisma server: docker-compose up -d

??3. Deploy your Prisma service: prisma deploy

??4. Read more about Prisma server:

?????http://bit.ly/prisma-server-overview

Generating schema... 20ms

Saving Prisma Client (JavaScript) at /Users/chunrong.liu/dev/study/prisma-study/generated/prisma-client/


至此,Prisma項目創建并初始化完畢。

接下來按昭Next steps下面的步驟提示執行后續操作。

通過以下命令切換當前目錄至剛創建的項目目錄(prisma-study)中。

cd prisma-study/


通過docker編排命令在docker中運行prisma服務器

docker-compose up -d


執行后命令行提示如下:

Creating prisma-study_prisma_1 … done

此時服務運行成功。


通過以下命令部署prisma服務。

$ prisma deploy

Creating stage default for service default ?

Deploying service `default` to stage `default` to server `local` 476ms

Changes:

??User (Type)

??+ Created type `User`

??+ Created field `id` of type `GraphQLID!`

??+ Created field `name` of type `String!`

??+ Created field `updatedAt` of type `DateTime!`

??+ Created field `createdAt` of type `DateTime!`

Applying changes 1.2s

Your Prisma GraphQL database endpoint is live:

??HTTP:??http://localhost:4466

??WS:????ws://localhost:4466

用流程器打開http://localhost:4466/鏈接地址,可以看到如下的UI界面。

前端技術之:Prisma Demo服務部署過程記錄

運行如下命令可以看到演練數據:

$ prisma playground

Serving playground at http://localhost:3000/playground


此時會自動打開瀏覽器,并顯示如下界面:

前端技術之:Prisma Demo服務部署過程記錄

關于數據庫無法連接的問題:

https://blog.csdn.net/liuchunming033/article/details/44810899

官方參考資料地址:

https://www.prisma.io/docs/quickstart/


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

民县| 合山市| 阿拉善右旗| 万荣县| 蓬安县| 中西区| 马边| 隆昌县| 万年县| 夏邑县| 奉贤区| 墨脱县| 富锦市| 三亚市| 静安区| 江口县| 玉门市| 阳城县| 卫辉市| 邵阳县| 平果县| 商城县| 东阳市| 图们市| 灵丘县| 丰城市| 章丘市| 沙河市| 深水埗区| 金塔县| 贵定县| 菏泽市| 双城市| 高台县| 金溪县| 伽师县| 龙泉市| 双柏县| 泽州县| 睢宁县| 益阳市|