Skip to content

Commit 9a00d52

Browse files
authored
Update README.md
Simplifying the getting started README for when this sqlcmd PR is pushed microsoft/go-sqlcmd#319
1 parent b8cac81 commit 9a00d52

1 file changed

Lines changed: 3 additions & 33 deletions

File tree

README.md

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ If you don't have a SQL Server or Azure SQL Emulator installed locally, you can
3030

3131
Install the `sqlcmd` tool, using the documentation available [here](https://learn.microsoft.com/en-us/sql/tools/sqlcmd/go-sqlcmd-utility).
3232

33-
Then download the latest version of SQL Server:
33+
Then download the latest version of SQL Server and deploy the .dacpac:
3434

3535
```shell
36-
sqlcmd create mssql --accept-eula --user-database TodoDB --context-name todo-demo
36+
sqlcmd create mssql --database TodoDB --use .\database\TodoDB\bin\Release\TodoDB.dacpac --context-name todo-demo
3737
```
3838

3939
once download is finished, make sure the container is running:
@@ -42,28 +42,6 @@ once download is finished, make sure the container is running:
4242
sqlcmd start todo-demo
4343
```
4444

45-
Get the connection string via
46-
47-
```shell
48-
sqlcmd config connection-strings
49-
```
50-
51-
and the copy the ADO.NET connection string to the clipboard. It will look like this:
52-
53-
```
54-
Server=<server>;Initial Catalog=master;Persist Security Info=False;User ID=<admin-user>;Password=<admin-password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;
55-
```
56-
57-
Now create a `.env` text file and paste the connection string in there, so that the value it is assigned to the `AZURE_SQL_DEPLOY_USER` environment variable. It should look like this:
58-
59-
```shell
60-
AZURE_SQL_DEPLOY_USER='Server=<server>;Initial Catalog=master;Persist Security Info=False;User ID=<admin-user>;Password=<admin-password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;'
61-
```
62-
63-
in the `.env` file just created, replace the `Initial Catalog` value from `master` to `TodoDB`.
64-
65-
The `deploy-db.ps1` script can be used to deploy the database to a local SQL Server instance or Azure SQL Emulator. It will create a new database called `TodoDB` and a new user called `todo_dab_user`.
66-
6745
### Run the app locally
6846

6947
Once database has been deployed, build the Vue fronted via
@@ -75,17 +53,9 @@ swa build
7553
If you haven't create an `.env` file yet, create one in the root folder, and the `AZURE_SQL_APP_USER` environment variable to set it to the connection string pointing to the local SQL Server instance or Azure SQL Emulator:
7654

7755
```shell
78-
AZURE_SQL_APP_USER='Server=<server>;Database=TodoDB;User ID=<username>;Password=<password>;TrustServerCertificate=true;'
56+
sqlcmd config connection-strings --type ADO.Net > secret & SET /p AZURE_SQL_APP_USER=<secret & del secret
7957
```
8058

81-
if you have used the provided script to deploy the database, the connection string will be:
82-
83-
```shell
84-
AZURE_SQL_APP_USER='Server=<server>;Database=TodoDB;User ID=todo_dab_user;Password=rANd0m_PAzzw0rd!;TrustServerCertificate=true;'
85-
```
86-
87-
please notice that the `<server>` value is the same as the one used to deploy the database. If you used `sqlcmd` to create the database, use `sqlcmd config connection-strings` to see that `<server>` is for you. If you only have one instance of SQL Server installed, it will be `localhost`.
88-
8959
Then start the app locally using the following command:
9060

9161
```shell

0 commit comments

Comments
 (0)