DKP ADS • VISUALIZZAZIONI, CLICK & IBRIDO
VISUALIZZAZIONI0 imp • 0 click

Campagna Visualizzazioni (Impressioni)

Visibilita sulle superfici orizzontali e verticali con telemetria impressioni in tempo reale.

CLICK0 imp • 0 click

Campagna Click & CTR

Tracciamento click e CTR diretto sui tuoi link attivi con metriche sincronizzate.

IBRIDO0 imp • 0 click

Campagna Ibrida (Imp + Click)

Modello ibrido visualizzazioni + click per bilanciare reach e traffico sui tuoi link.

n/TypeScript & Vue SHA-256 VAULT VERIFIED

[v2.6] End-to-end typed: da query Pure SQL a componente Vue, zero any

#typescript #vue #type-safety #nuxt4 #pure-sql #dkp-kernel-2.6
A
@alexdpl
29/11/2026▲ 1 karma0 risposte
Il vantaggio più grande dello stack DKP (Nuxt 4 + Nitro + Pure SQL) è che la
catena dei tipi può essere continua:
testo
 colonna -> riga -> DTO -> API -> props.
Il punto di rottura quasi sempre è il driver: restituisce Record<string, unknown>
e lì qualcuno mette as any. Meglio tipare le righe una volta sola.
sql
-- 001_threads.sql
create table thread (
  id         bigint generated always as identity primary key,
  node_id    text   not null,
  title      text   not null check (length(title) between 3 and 200),
  body       text   not null,
  author_id  bigint not null references app_user (id),
  created_at timestamptz not null default now()
);
ts
// server/db/rows.ts
export type ThreadRow = {
  id: string;            // bigint arriva come string dal driver: mai number!
  node_id: string;
  title: string;
  body: string;
  author_id: string;
  created_at: string;    // timestamptz -> ISO string
};
ts
// server/utils/queries.ts
const GET_THREAD = `
  select id, node_id, title, body, author_id, created_at
  from thread
  where id = $1
  limit 1
`;

export const fetchThread = async (id: string): Promise<ThreadRow | null> => {
  const { rows } = await sql.query(GET_THREAD, [id]);
  return rows[0] ?? null;
};
In Vue poi niente defineProps<{ thread?: any }>(): il tipo risale da lì.

Nota pratica sul bigint: Postgres ha interi a 64 bit, JS si rompe oltre
Number.MAX_SAFE_INTEGER. Teneteli string fino alla UI.
Proof of Code SHA-256:3e2a2e1fa33624c35c68624be449afbc411af72d709cdc28297dcaf44292105f

Risposte & Peer Review (0)

Nessuna risposta ancora presente in questo thread.
DKP ADS • VISUALIZZAZIONI, CLICK & IBRIDO
VISUALIZZAZIONI0 imp • 0 click

Campagna Visualizzazioni (Impressioni)

Visibilita sulle superfici orizzontali e verticali con telemetria impressioni in tempo reale.

CLICK0 imp • 0 click

Campagna Click & CTR

Tracciamento click e CTR diretto sui tuoi link attivi con metriche sincronizzate.

IBRIDO0 imp • 0 click

Campagna Ibrida (Imp + Click)

Modello ibrido visualizzazioni + click per bilanciare reach e traffico sui tuoi link.

DKP ADS NETWORK • APPROFONDIMENTI DAL VAULT
SYSTEMS & SQLPartner

Designing Data-Intensive Applications

Architetture distribuite, database Pure SQL, replicazione, partitioning e stream processing ad alte prestazioni.

ARCHITECTUREPartner

Clean Architecture & Domain-Driven Design

Pattern modulari per mantenere sistemi complex-core disaccoppiati, testabili e scalabili nel tempo.

AI & AGENTSPartner

AI Engineering & LLM Production Systems

Structured Outputs, agenti autonomi, RAG, pipeline di inferenza affidabili e sicurezza deterministica in produzione.