# aldirvn/ewhere architecture

> Architecture diagram of the GitHub repository aldirvn/ewhere, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aldirvn/ewhere
- Repository: https://github.com/aldirvn/ewhere

## Overview

ewhere is a small Go library for turning SQL templates with ?field placeholders into a cleaned query and ordered argument slice. The principal workflow is a caller passing a template and parameter map to Parse; Parse handles missing or empty values, scalar values, and slices, then removes temporary conditions before returning the result. The source shows this behavior within one implementation file; no separate storage, database execution, or external integration is present.

Main entry points: [`ewhere.go`](https://github.com/aldirvn/ewhere/blob/master/ewhere.go) (Parse template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_parse["SQL parsing"]
  node_parse["Parse template<br/>[ewhere.go]"]
  node_slices["Slice IN clauses<br/>[ewhere.go]"]
end

node_caller(("Package caller"))
node_result["Query and args"]

node_caller -->|"calls"| node_parse
node_parse -->|"delegates slices"| node_slices
node_parse -->|"returns"| node_result

click node_parse "https://github.com/aldirvn/ewhere/blob/master/ewhere.go"
click node_slices "https://github.com/aldirvn/ewhere/blob/master/ewhere.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_parse,node_slices toneBlue
class node_caller,node_result toneIndigo
```

## Components

### SQL parsing

- [Parse template](https://github.com/aldirvn/ewhere/blob/master/ewhere.go): `ewhere.go`
- [Slice IN clauses](https://github.com/aldirvn/ewhere/blob/master/ewhere.go): `ewhere.go`

### Other components

- **Package caller**
- **Query and args**

## Connections

- Package caller → Parse template: calls (evidence: `README.md`)
- Parse template → Slice IN clauses: delegates slices (evidence: `ewhere.go`)
- Parse template → Query and args: returns (evidence: `ewhere.go`)
