@suss/adapter-python 0.32.0 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -115,6 +115,8 @@ interface PythonPack {
115
115
  contextManagers?: PyContextManager[];
116
116
  /** How the library lets a project hand the database SQL it wrote itself. */
117
117
  rawSql?: RawSqlPattern[];
118
+ /** The client objects the library hands a project, and the calls on one that reach the database. */
119
+ sqlClients?: SqlClientPattern[];
118
120
  }
119
121
  /**
120
122
  * A call talks to the database when the method behind it says it returns one
@@ -212,6 +214,66 @@ interface RawSqlPattern {
212
214
  /** Which database the library is talking to, for the boundary binding. */
213
215
  storageSystem: "postgresql" | "mysql" | "sqlite";
214
216
  }
217
+ /**
218
+ * A client object a library hands a project, and the calls on one that
219
+ * reach the database. `RawSqlPattern` matches a function the file
220
+ * imported; this matches a method on a value whose class came out of
221
+ * the library, which is how a client built in one module and called in
222
+ * another still reads.
223
+ *
224
+ * Every field here is the library's own: the module, the class names,
225
+ * the method names, and where each method takes what it is given.
226
+ */
227
+ interface SqlClientPattern {
228
+ /** The module the client class comes from, `google.cloud.bigquery`. */
229
+ module: string;
230
+ /** The class names whose instances take these calls, `Client`. */
231
+ clientTypes: string[];
232
+ /** The methods that hand the database a statement, and where each takes it. */
233
+ statements?: SqlStatementCall[];
234
+ /** The methods that say which table rather than writing SQL, and what each does to it. */
235
+ tables?: SqlTableCall[];
236
+ /** The methods that hand back one of another library class, so a chain off one reaches its calls. */
237
+ handsBack?: SqlClientHandoff[];
238
+ /** Which database the client is talking to, for the boundary binding. */
239
+ storageSystem: string;
240
+ /** Which SQL dialect the statements are written in, when that is not the storage system's own name. */
241
+ dialect?: string;
242
+ }
243
+ /** Where one method takes what it is given: a position, a keyword, or both. */
244
+ interface SqlCallArgument {
245
+ /** The position it is written at. */
246
+ argument?: number;
247
+ /** The keyword it may be written under instead. */
248
+ keyword?: string;
249
+ }
250
+ /** One method that takes a statement written as SQL. */
251
+ interface SqlStatementCall extends SqlCallArgument {
252
+ /** The method name, `query`. */
253
+ method: string;
254
+ /**
255
+ * The keys down to the statement when it travels inside a dictionary
256
+ * rather than as the argument itself, the `["query", "query"]` of
257
+ * `insert_job(configuration={"query": {"query": sql}})`.
258
+ */
259
+ path?: string[];
260
+ }
261
+ /** One method that says which table it works on, and what it does to it. */
262
+ interface SqlTableCall extends SqlCallArgument {
263
+ /** The method name, `get_table`. */
264
+ method: string;
265
+ /** Whether the call changes what is stored. */
266
+ kind: "read" | "write";
267
+ }
268
+ /** One method that hands back an object of another of the library's classes. */
269
+ interface SqlClientHandoff {
270
+ /** The method name, Airflow's `get_client`. */
271
+ method: string;
272
+ /** The module the class it hands back comes from. */
273
+ module: string;
274
+ /** That class's name. */
275
+ name: string;
276
+ }
215
277
  type PythonDiscoveryPattern = DecoratedClassRoute | DecoratedFunctionRoute;
216
278
  /**
217
279
  * A class whose `__enter__` gives back the object it was called on, so
@@ -768,6 +830,8 @@ interface StorageLookup {
768
830
  readonly couldMatch: ReadonlySet<string>;
769
831
  /** What a pack says about statements a project writes as SQL itself. */
770
832
  readonly rawSql?: readonly RawSqlPattern[];
833
+ /** What a pack says about the client objects its library hands a project. */
834
+ readonly sqlClients?: readonly SqlClientPattern[];
771
835
  }
772
836
 
773
837
  /**
@@ -1112,4 +1176,4 @@ declare function pythonImportEvidence(options: PythonImportEvidenceOptions): Pro
1112
1176
  */
1113
1177
  declare const ADAPTER_VERSION = "0.1.0";
1114
1178
 
1115
- export { ADAPTER_VERSION, type AnnotationContext, type Binding, type BoundPythonFile, type DecoratedClassRoute, type DecoratedFunctionRoute, type DecoratorArg, type DecoratorClassification, type DiscoveryOptions, type ExtractPythonOptions, type ExtractPythonResult, type FileFactsOptions, type ModuleBinding, type ModuleResolution, type ModuleResolverOptions, type MountObjectCarrier, type MountObjectPrefix, type MountPrefixEffect, type NoValuePrefix, type PathRepeatedSlashes, type PrefixTrailingSlash, type PyModelEntryFunction, type PyModelEntryMethod, type PyModelQueries, type PyStatusCall, type PythonDiscoveryPattern, type PythonImportEvidence, type PythonImportEvidenceOptions, type PythonImportSite, type PythonPack, type PythonValueHandle, PythonWhySession, type PythonWhySessionOptions, type RawSqlPattern, type RelativeModuleSpec, type RouteConventions, type RoutePrefixResolution, type RouterComposition, type RouterIndex, type Scope, type ScopeKind, type StoragePattern, annotationToShape, bindModule, buildRouterIndex, classifyDecorator, containedValues, discoverUnits, emitEntryFact, emitModuleImportFacts, emitValueFacts, extractPythonProject, factsForFile, findPythonFiles, nameKeyIn, nodeId, objectReturnedBy, parsePython, parsePythonSync, preloadPythonGrammar, pythonImportEvidence, readKey, resolveAbsoluteModule, resolveCalls, resolveModule, resolveName, resolveRelativeModule, shapeFromName, unitKey };
1179
+ export { ADAPTER_VERSION, type AnnotationContext, type Binding, type BoundPythonFile, type DecoratedClassRoute, type DecoratedFunctionRoute, type DecoratorArg, type DecoratorClassification, type DiscoveryOptions, type ExtractPythonOptions, type ExtractPythonResult, type FileFactsOptions, type ModuleBinding, type ModuleResolution, type ModuleResolverOptions, type MountObjectCarrier, type MountObjectPrefix, type MountPrefixEffect, type NoValuePrefix, type PathRepeatedSlashes, type PrefixTrailingSlash, type PyModelEntryFunction, type PyModelEntryMethod, type PyModelQueries, type PyStatusCall, type PythonDiscoveryPattern, type PythonImportEvidence, type PythonImportEvidenceOptions, type PythonImportSite, type PythonPack, type PythonValueHandle, PythonWhySession, type PythonWhySessionOptions, type RawSqlPattern, type RelativeModuleSpec, type RouteConventions, type RoutePrefixResolution, type RouterComposition, type RouterIndex, type Scope, type ScopeKind, type SqlCallArgument, type SqlClientHandoff, type SqlClientPattern, type SqlStatementCall, type SqlTableCall, type StoragePattern, annotationToShape, bindModule, buildRouterIndex, classifyDecorator, containedValues, discoverUnits, emitEntryFact, emitModuleImportFacts, emitValueFacts, extractPythonProject, factsForFile, findPythonFiles, nameKeyIn, nodeId, objectReturnedBy, parsePython, parsePythonSync, preloadPythonGrammar, pythonImportEvidence, readKey, resolveAbsoluteModule, resolveCalls, resolveModule, resolveName, resolveRelativeModule, shapeFromName, unitKey };
package/dist/index.d.ts CHANGED
@@ -115,6 +115,8 @@ interface PythonPack {
115
115
  contextManagers?: PyContextManager[];
116
116
  /** How the library lets a project hand the database SQL it wrote itself. */
117
117
  rawSql?: RawSqlPattern[];
118
+ /** The client objects the library hands a project, and the calls on one that reach the database. */
119
+ sqlClients?: SqlClientPattern[];
118
120
  }
119
121
  /**
120
122
  * A call talks to the database when the method behind it says it returns one
@@ -212,6 +214,66 @@ interface RawSqlPattern {
212
214
  /** Which database the library is talking to, for the boundary binding. */
213
215
  storageSystem: "postgresql" | "mysql" | "sqlite";
214
216
  }
217
+ /**
218
+ * A client object a library hands a project, and the calls on one that
219
+ * reach the database. `RawSqlPattern` matches a function the file
220
+ * imported; this matches a method on a value whose class came out of
221
+ * the library, which is how a client built in one module and called in
222
+ * another still reads.
223
+ *
224
+ * Every field here is the library's own: the module, the class names,
225
+ * the method names, and where each method takes what it is given.
226
+ */
227
+ interface SqlClientPattern {
228
+ /** The module the client class comes from, `google.cloud.bigquery`. */
229
+ module: string;
230
+ /** The class names whose instances take these calls, `Client`. */
231
+ clientTypes: string[];
232
+ /** The methods that hand the database a statement, and where each takes it. */
233
+ statements?: SqlStatementCall[];
234
+ /** The methods that say which table rather than writing SQL, and what each does to it. */
235
+ tables?: SqlTableCall[];
236
+ /** The methods that hand back one of another library class, so a chain off one reaches its calls. */
237
+ handsBack?: SqlClientHandoff[];
238
+ /** Which database the client is talking to, for the boundary binding. */
239
+ storageSystem: string;
240
+ /** Which SQL dialect the statements are written in, when that is not the storage system's own name. */
241
+ dialect?: string;
242
+ }
243
+ /** Where one method takes what it is given: a position, a keyword, or both. */
244
+ interface SqlCallArgument {
245
+ /** The position it is written at. */
246
+ argument?: number;
247
+ /** The keyword it may be written under instead. */
248
+ keyword?: string;
249
+ }
250
+ /** One method that takes a statement written as SQL. */
251
+ interface SqlStatementCall extends SqlCallArgument {
252
+ /** The method name, `query`. */
253
+ method: string;
254
+ /**
255
+ * The keys down to the statement when it travels inside a dictionary
256
+ * rather than as the argument itself, the `["query", "query"]` of
257
+ * `insert_job(configuration={"query": {"query": sql}})`.
258
+ */
259
+ path?: string[];
260
+ }
261
+ /** One method that says which table it works on, and what it does to it. */
262
+ interface SqlTableCall extends SqlCallArgument {
263
+ /** The method name, `get_table`. */
264
+ method: string;
265
+ /** Whether the call changes what is stored. */
266
+ kind: "read" | "write";
267
+ }
268
+ /** One method that hands back an object of another of the library's classes. */
269
+ interface SqlClientHandoff {
270
+ /** The method name, Airflow's `get_client`. */
271
+ method: string;
272
+ /** The module the class it hands back comes from. */
273
+ module: string;
274
+ /** That class's name. */
275
+ name: string;
276
+ }
215
277
  type PythonDiscoveryPattern = DecoratedClassRoute | DecoratedFunctionRoute;
216
278
  /**
217
279
  * A class whose `__enter__` gives back the object it was called on, so
@@ -768,6 +830,8 @@ interface StorageLookup {
768
830
  readonly couldMatch: ReadonlySet<string>;
769
831
  /** What a pack says about statements a project writes as SQL itself. */
770
832
  readonly rawSql?: readonly RawSqlPattern[];
833
+ /** What a pack says about the client objects its library hands a project. */
834
+ readonly sqlClients?: readonly SqlClientPattern[];
771
835
  }
772
836
 
773
837
  /**
@@ -1112,4 +1176,4 @@ declare function pythonImportEvidence(options: PythonImportEvidenceOptions): Pro
1112
1176
  */
1113
1177
  declare const ADAPTER_VERSION = "0.1.0";
1114
1178
 
1115
- export { ADAPTER_VERSION, type AnnotationContext, type Binding, type BoundPythonFile, type DecoratedClassRoute, type DecoratedFunctionRoute, type DecoratorArg, type DecoratorClassification, type DiscoveryOptions, type ExtractPythonOptions, type ExtractPythonResult, type FileFactsOptions, type ModuleBinding, type ModuleResolution, type ModuleResolverOptions, type MountObjectCarrier, type MountObjectPrefix, type MountPrefixEffect, type NoValuePrefix, type PathRepeatedSlashes, type PrefixTrailingSlash, type PyModelEntryFunction, type PyModelEntryMethod, type PyModelQueries, type PyStatusCall, type PythonDiscoveryPattern, type PythonImportEvidence, type PythonImportEvidenceOptions, type PythonImportSite, type PythonPack, type PythonValueHandle, PythonWhySession, type PythonWhySessionOptions, type RawSqlPattern, type RelativeModuleSpec, type RouteConventions, type RoutePrefixResolution, type RouterComposition, type RouterIndex, type Scope, type ScopeKind, type StoragePattern, annotationToShape, bindModule, buildRouterIndex, classifyDecorator, containedValues, discoverUnits, emitEntryFact, emitModuleImportFacts, emitValueFacts, extractPythonProject, factsForFile, findPythonFiles, nameKeyIn, nodeId, objectReturnedBy, parsePython, parsePythonSync, preloadPythonGrammar, pythonImportEvidence, readKey, resolveAbsoluteModule, resolveCalls, resolveModule, resolveName, resolveRelativeModule, shapeFromName, unitKey };
1179
+ export { ADAPTER_VERSION, type AnnotationContext, type Binding, type BoundPythonFile, type DecoratedClassRoute, type DecoratedFunctionRoute, type DecoratorArg, type DecoratorClassification, type DiscoveryOptions, type ExtractPythonOptions, type ExtractPythonResult, type FileFactsOptions, type ModuleBinding, type ModuleResolution, type ModuleResolverOptions, type MountObjectCarrier, type MountObjectPrefix, type MountPrefixEffect, type NoValuePrefix, type PathRepeatedSlashes, type PrefixTrailingSlash, type PyModelEntryFunction, type PyModelEntryMethod, type PyModelQueries, type PyStatusCall, type PythonDiscoveryPattern, type PythonImportEvidence, type PythonImportEvidenceOptions, type PythonImportSite, type PythonPack, type PythonValueHandle, PythonWhySession, type PythonWhySessionOptions, type RawSqlPattern, type RelativeModuleSpec, type RouteConventions, type RoutePrefixResolution, type RouterComposition, type RouterIndex, type Scope, type ScopeKind, type SqlCallArgument, type SqlClientHandoff, type SqlClientPattern, type SqlStatementCall, type SqlTableCall, type StoragePattern, annotationToShape, bindModule, buildRouterIndex, classifyDecorator, containedValues, discoverUnits, emitEntryFact, emitModuleImportFacts, emitValueFacts, extractPythonProject, factsForFile, findPythonFiles, nameKeyIn, nodeId, objectReturnedBy, parsePython, parsePythonSync, preloadPythonGrammar, pythonImportEvidence, readKey, resolveAbsoluteModule, resolveCalls, resolveModule, resolveName, resolveRelativeModule, shapeFromName, unitKey };