Skip to content

Commit

Permalink
add models to connection type
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jan 14, 2025
1 parent aa0f0e9 commit 11db183
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dist/src/driver/connection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Collection, MongooseCollectionOptions } from './collection';
import { AstraAdmin, CollectionDescriptor, CreateTableDefinition, DataAPIDbAdmin, ListCollectionsOptions, ListTablesOptions, RawDataAPIResponse, TableDescriptor } from '@datastax/astra-db-ts';
import { CollectionsDb, TablesDb } from './db';
import { default as MongooseConnection } from 'mongoose/lib/connection';
import type { ConnectOptions, Mongoose } from 'mongoose';
import type { ConnectOptions, Mongoose, Model } from 'mongoose';
import { DataAPIClient } from '@datastax/astra-db-ts';
interface ConnectOptionsInternal extends ConnectOptions {
useTables?: boolean;
Expand All @@ -25,6 +25,7 @@ export declare class Connection extends MongooseConnection {
config?: ConnectOptionsInternal;
baseUrl: string | null;
baseApiPath: string | null;
models: Record<string, Model<unknown>>;
constructor(base: Mongoose);
/**
* Helper borrowed from Mongoose to wait for the connection to finish connecting. Because Mongoose
Expand Down
1 change: 1 addition & 0 deletions dist/src/driver/connection.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/driver/connection.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/driver/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class Connection extends MongooseConnection {
config?: ConnectOptionsInternal;
baseUrl: string | null = null;
baseApiPath: string | null = null;
models: Record<string, Model<unknown>> = {};

constructor(base: Mongoose) {
super(base);
Expand Down

0 comments on commit 11db183

Please sign in to comment.