sqledge

package
v0.44.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAcceptEULA

func WithAcceptEULA() testcontainers.CustomizeRequestOption

WithAcceptEULA sets the ACCEPT_EULA environment variable to "Y", indicating acceptance of the Microsoft Azure SQL Edge End-User License Agreement. This option is required; Run returns an error if it is not provided.

func WithPassword

func WithPassword(password string) testcontainers.CustomizeRequestOption

WithPassword sets the MSSQL_SA_PASSWORD environment variable to the provided password. The password must meet SQL Server complexity requirements: uppercase + lowercase + number + special char.

Types

type Container

type Container struct {
	testcontainers.Container
	// contains filtered or unexported fields
}

Container represents the Azure SQL Edge container type used in the module

func Run

Run creates an instance of the Azure SQL Edge container type. Callers must pass WithAcceptEULA() to accept the Microsoft license agreement.

Example
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/testcontainers/testcontainers-go"
	"github.com/testcontainers/testcontainers-go/modules/azure/sqledge"
)

func main() {
	// runSQLEdgeContainer {
	ctx := context.Background()

	sqlEdgeContainer, err := sqledge.Run(ctx,
		"mcr.microsoft.com/azure-sql-edge:1.0.7",
		sqledge.WithAcceptEULA(),
		sqledge.WithPassword("Strong!Passw0rd"),
	)
	defer func() {
		if err := testcontainers.TerminateContainer(sqlEdgeContainer); err != nil {
			log.Printf("failed to terminate container: %s", err)
		}
	}()
	if err != nil {
		log.Printf("failed to start container: %s", err)
		return
	}
	// }

	state, err := sqlEdgeContainer.State(ctx)
	if err != nil {
		log.Printf("failed to get container state: %s", err)
		return
	}

	fmt.Println(state.Running)

}
Output:
true

func (*Container) ConnectionString

func (c *Container) ConnectionString(ctx context.Context, args ...string) (string, error)

ConnectionString returns the connection string for the Azure SQL Edge container, using the default 1433 port. Additional query parameters may be appended via args. Example: container.ConnectionString(ctx, "encrypt=false", "TrustServerCertificate=true")

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL