array-driver

command
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

README

Array Driver Example

This example demonstrates how to use the array driver to query static or computed data using Neat's ORM.

Overview

The array driver is useful for:

  • Static data like roles, statuses, or country lists.
  • Mocking data for tests.
  • Querying computed datasets as if they were in a real database.

How it works

  1. Define a struct that implements contractsorm.ArraySource.
  2. Configure a connection using the array driver.
  3. Use the query builder normally by passing the ArraySource to .Model().

Neat will automatically:

  • Infer the schema from the first row of data.
  • Create an in-memory SQLite table.
  • Populate the table with the provided rows.
  • Execute your queries against this in-memory table.

Running the example

go run examples/array-driver/main.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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