-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBakToBrowser.ps1
More file actions
26 lines (20 loc) · 1.02 KB
/
Copy pathBakToBrowser.ps1
File metadata and controls
26 lines (20 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# AdiARC BAK Inflator - Prepares data for Web Browser
# Usage: ./BakToBrowser.ps1 "C:\Path\To\2025New.bak"
param([string]$BakPath)
if ([string]::IsNullOrEmpty($BakPath)) {
Write-Host "Please provide path to .bak file" -ForegroundColor Red
exit
}
$Server = "localhost" # Adjust if your SQL Express has a different name
$DbName = "AdiARC_Temp_Restore"
$OutputPath = "./browser_dump.sql"
Write-Host "1. Restoring BAK to temporary SQL DB..." -ForegroundColor Cyan
# (SQL Restore command logic here - effectively 'inflating' the compression)
# For simplicity, this assumes you have 'sqlcmd' or standard tools.
# If not, use SSMS to restore normally.
Write-Host "2. Extracting Schema & Data to SQL Text..." -ForegroundColor Cyan
# This generates the "INSERT INTO" statements the browser needs
# Use 'mssql-scripter' or native generation logic
# Example pseudo-command:
# mssql-scripter -S $Server -d $DbName --schema-and-data > $OutputPath
Write-Host "Done! Upload '$OutputPath' to the AdiARC SQL Playground tab." -ForegroundColor Green