Align class names and code structure with the connectors in other languages

Aperta
#341 0 commenti 1 reazione 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@hessjcg ci sta già lavorando.

Dal 30/4/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

priority: p2 type: feature request

The connectors in the other languages are structured with common names and separation of concerns.

Public API:

  • Connector is the main public API to configure and connect.
  • ConnectionOptions is the value object containing connection options. main public API to configure and connect.

Internal API:

  • ConnectorRegistry is the internal class that holds configuration and caches for each database instance.
  • ConnectionInfo is a value object that holds the configuration and data for one database instance.
  • ConnectionInfoCache interface holds the active ConnectionInfo value for a single database instance and keeps it up to date, refreshing the data as needed.
  • RefreshAheadCache implements the ConnectionInfoCache using the current connector refresh algorithm
  • LazyRefreshCache (to be added with #285) implements ConnectionInfoCache using the lazy refresh algorithm.
  • ConnectionInfoRepository calls the Cloud SQL Admin API to build an up-to-date ConnectionInfo object.

To get to the NodeJS connector codebase into state, we will need to move some code and rename some classes.

  • Rename CloudSQLInstanceMap to ConnectorRegistry
  • Rename InstanceConnectionInfo to ConnectionInfo
  • Rename CloudSQLInstance class to RefreshAheadCache
  • Rename Fetcher interface to ConnectionInfoRepository
  • Rename SqlAdminFetcher class to DefaultConnectionInfoRepository
Lingua principale
TypeScript
Stelle
99
Fork
18
Merge medio
1g 23h
PR unite (30g)
20

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GoogleCloudPlatform/cloud-sql-nodejs-connector

Tutte le issue di GoogleCloudPlatform/cloud-sql-nodejs-connector

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.