orm

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertValue

func ConvertValue(value any) any

Export utility functions for backward compatibility

Types

type JSConformanceTests

type JSConformanceTests struct {
	DriverName      string
	DatabaseURI     string
	SkipTests       map[string]bool
	Characteristics JSDriverCharacteristics
	CleanupTables   func(t *testing.T, runner *JSTestRunner) // Driver-specific table cleanup
}

JSConformanceTests provides a comprehensive test suite for JavaScript ORM API

func (*JSConformanceTests) RunAll

func (jct *JSConformanceTests) RunAll(t *testing.T)

RunAll runs all JavaScript conformance tests

type JSDriverCharacteristics

type JSDriverCharacteristics struct {
	// SupportsArrayTypes indicates if the driver supports array field types
	SupportsArrayTypes bool

	// SupportsJSONTypes indicates if the driver supports JSON/JSONB field types
	SupportsJSONTypes bool

	// SupportsEnumTypes indicates if the driver supports enum field types
	SupportsEnumTypes bool

	// MaxConnectionPoolSize is the maximum number of connections in the pool
	MaxConnectionPoolSize int

	// SupportsNestedTransactions indicates if the driver supports savepoints
	SupportsNestedTransactions bool
}

JSDriverCharacteristics defines JavaScript-specific driver behaviors

type JSTestRunner

type JSTestRunner struct {
	// contains filtered or unexported fields
}

JSTestRunner provides utilities for running JavaScript tests

func NewJSTestRunner

func NewJSTestRunner(t *testing.T) (*JSTestRunner, error)

NewJSTestRunner creates a new JavaScript test runner

func (*JSTestRunner) Cleanup

func (r *JSTestRunner) Cleanup()

Cleanup removes temporary test files

func (*JSTestRunner) CopyTestAssets

func (r *JSTestRunner) CopyTestAssets() error

CopyTestAssets copies test assets (like assert.js, test schemas) to the temp directory

func (*JSTestRunner) GetDatabaseURI

func (r *JSTestRunner) GetDatabaseURI() string

GetDatabaseURI returns the database URI for tests

func (*JSTestRunner) RunCleanupScript

func (r *JSTestRunner) RunCleanupScript(cleanupCode string) error

RunCleanupScript runs a JavaScript cleanup script

func (*JSTestRunner) RunInlineTest

func (r *JSTestRunner) RunInlineTest(t *testing.T, testName string, testCode string)

RunInlineTest runs an inline JavaScript test

func (*JSTestRunner) RunScript

func (r *JSTestRunner) RunScript(scriptContent string, args ...string) error

RunScript executes a JavaScript script with the given content

func (*JSTestRunner) RunTestFile

func (r *JSTestRunner) RunTestFile(t *testing.T, filename string) error

RunTestFile executes a JavaScript test file from testdata directory

func (*JSTestRunner) SetDatabaseURI

func (r *JSTestRunner) SetDatabaseURI(uri string)

SetDatabaseURI sets the database URI for tests

type LoggerWrapper added in v0.4.0

type LoggerWrapper struct {
	// contains filtered or unexported fields
}

LoggerWrapper wraps a Go logger for JavaScript use

type ModelsModule

type ModelsModule struct {
	// contains filtered or unexported fields
}

ModelsModule provides Prisma-like database operations using ORM as the backend

Jump to

Keyboard shortcuts

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