Skip to content

Commit

Permalink
sqlproj readme updates (#26107)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzsquared authored Dec 19, 2024
1 parent fe72ef6 commit 79efff9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
54 changes: 36 additions & 18 deletions extensions/sql-database-projects/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,57 @@
# SQL Database Projects for Azure Data Studio and VS Code
# SQL Database Projects extension

Database source control where objects are stored as code, integrating with build-time validation and dynamically calculated deployments for database DevOps. Cross-platform and compatible with Visual Studio SQL Server Data Tools (SSDT) for SQL Server, Azure SQL, and Fabric SQL.

## Overview

SQL Database Projects for Azure Data Studio and VS Code provides a way to design, edit, and publish schemas for SQL databases from a source controlled project. For a complete development workflow, build and deploy your database projects in CI/CD pipelines, such as [GitHub Actions](https://github.com/azure/sql-action) or Azure DevOps.
SQL Database Projects for Azure Data Studio and VS Code provides a way to design, edit, and publish objects to SQL databases from a source controlled project. For a complete development workflow, build and deploy your database projects in CI/CD pipelines, such as [GitHub Actions](https://github.com/azure/sql-action) or Azure DevOps.

Learn more about the SQL Database Projects extension in the documentation: https://aka.ms/azuredatastudio-sqlprojects
![SQL project lifecycle](https://raw.githubusercontent.com/microsoft/azuredatastudio/main/extensions/sql-database-projects/images/sqlproj-lifecycle.png)

## Features
📕 Learn more about SQL Database Projects in the documentation: https://aka.ms/sqlprojects

- Develop database objects using T-SQL
- Store the database schema in source control
- Validate object relationships with project build
- Publish the database objects to a SQL Server or Azure SQL instance
- Publish the database objects to a local development container
- Update the database project from a database
## Requirements

### Preview Features
The extension will prompt to install the [.NET SDK](https://aka.ms/sqlprojects-dotnet) if it is not found, as it is required to build SQL projects. You can also install the .NET SDK manually from [here](https://aka.ms/sqlprojects-dotnet) for Windows, macOS, and Linux.

- Microsoft.Build.Sql SDK-style projects
- Generate SQL projects from OpenAPI/Swagger specs
## Quick start

1. Create a new database project by going to the Database Projects view or by searching for Database Projects: New in the command palette.
2. Add `.sql` files to the project to define database objects. For example, creating a file `Product.sql` in the SQL project folder to add a table named `Product`:
```sql
CREATE TABLE [dbo].[Product](
[ProductID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
[ProductName] [nvarchar](200) NOT NULL
);
```
3. Build the SQL project to validate the SQL syntax and object references. In the Database Projects view, right-click the database project's root node and select Build.
4. Building the project created a `.dacpac` file in the output folder. This file contains the schema of the database project and can be deployed to a SQL Server or Azure SQL instance.

📕 Dive in further with this complete tutorial for [creating and deploying a SQL project](https://learn.microsoft.com/sql/tools/sql-database-projects/tutorials/create-deploy-sql-project?pivots=sq1-visual-studio-code).

![AdventureWorks SQL project](https://raw.githubusercontent.com/microsoft/azuredatastudio/main/extensions/sql-database-projects/images/readme-sqlproj.png)

## Features

- [Develop and validate database objects using T-SQL](https://learn.microsoft.com/sql/tools/sql-database-projects/sql-database-projects#validation)
- [Start from an existing database to get it in source control](https://learn.microsoft.com/sql/tools/sql-database-projects/tutorials/start-from-existing-database?pivots=sq1-visual-studio-code)
- [Publish the database objects to a SQL Server or Azure SQL instance](https://learn.microsoft.com/sql/tools/sql-database-projects/sql-database-projects#deployment)
- [Publish the database objects to a local development container](https://learn.microsoft.com/azure-data-studio/extensions/sql-database-project-extension-build#publish-the-sql-project-and-deploy-to-a-local-container)
- [Automate generation of deployment scripts and reports](https://learn.microsoft.com/sql/tools/sqlpackage/sqlpackage#deployments)
- [Update the database project from a database and visualize differences](https://learn.microsoft.com/sql/tools/sql-database-projects/howto/compare-database-project?pivots=sq1-visual-studio-code)
- [Code analysis for best practices](https://learn.microsoft.com/sql/tools/sql-database-projects/concepts/sql-code-analysis/sql-code-analysis?pivots=sq1-visual-studio-code)
- [Include custom scripts before and after deployment](https://learn.microsoft.com/sql/tools/sql-database-projects/concepts/pre-post-deployment-scripts?pivots=sq1-visual-studio-code)
- [Declare deploy-time variables](https://learn.microsoft.com/sql/tools/sql-database-projects/concepts/sqlcmd-variables?pivots=sq1-visual-studio-code)

## Getting Started with Database Projects
### Preview Features

* Create a new database project by going to the `Database Projects` view or by searching `Database Projects: New` in the command palette.
* Existing database projects can be opened by going to the `Database Projects` view or by searching `Database Projects: Open existing` in the command palette.
* Start from an existing database by using `Create Project from Database` from the command palette or database context menu.
* Start from an OpenAPI/Swagger spec by using the `Generate SQL Project from OpenAPI/Swagger spec` command (Preview).
- Microsoft.Build.Sql SDK-style projects
- Generate SQL projects from OpenAPI/Swagger specs

## Settings

### General Settings

- `sqlDatabaseProjects.dotnetSDK Location`: The path to the folder containing the `dotnet` folder for the .NET SDK. If not set, the extension will attempt to find the .NET SDK on the system.
- `sqlDatabaseProjects.microsoftBuildSqlVersion`: Version of Microsoft.Build.Sql binaries used when building SQL projects that are not SDK-style SQL projects. If not set, the extension will use Microsoft.Build.Sql 0.2.5-preview.
- `sqlDatabaseProjects.netCoreDoNotAsk`: When true, no longer prompts to install .NET SDK when a supported installation is not found.
Expand Down
Binary file modified extensions/sql-database-projects/images/readme-sqlproj.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 79efff9

Please sign in to comment.