Skip to content

Commit 3e63d39

Browse files
Remove initializeDatabase
1 parent 0c9b7be commit 3e63d39

File tree

4 files changed

+3
-25
lines changed

4 files changed

+3
-25
lines changed

packages/database/exp-types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import { FirebaseApp } from '@firebase/app-types';
1919

20-
export { initializeDatabase, getDatabase } from '../src/exp/Database';
20+
export { getDatabase } from '../src/exp/Database';
2121

2222
export interface DataSnapshot {
2323
child(path: string): DataSnapshot;

packages/database/exp/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import { FirebaseDatabase } from '../src/exp/Database';
2424

2525
export {
2626
getDatabase,
27-
initializeDatabase,
2827
FirebaseDatabase,
2928
ServerValue
3029
} from '../src/exp/Database';

packages/database/src/exp/Database.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -103,27 +103,6 @@ export class FirebaseDatabase implements _FirebaseService {
103103
const ServerValue = Database.ServerValue;
104104
export { ServerValue };
105105

106-
/**
107-
* Initializes a new instance of the Realtime Database. If a custom database URL
108-
* is specified, the URL overrides the database URL provided by the Firebase
109-
* App.
110-
*
111-
* @param app - The {@link FirebaseApp} with which the Realtime Database
112-
* instance will be associated with.
113-
* @param url - The URL of the Realtime Database instance to connect to. If not
114-
* provided, the SDK connects to the default instance of the Firebase App.
115-
* @returns A newly initialized `FirebaseDatabase` instance.
116-
*/
117-
export function initializeDatabase(
118-
app: FirebaseApp,
119-
url?: string
120-
): FirebaseDatabase {
121-
const database = _getProvider(app, 'database-exp').getImmediate({
122-
identifier: url
123-
}) as FirebaseDatabase;
124-
return database;
125-
}
126-
127106
/**
128107
* Returns the instance of the Realtime Database SDK that is associated
129108
* with the provided {@link FirebaseApp}. Initializes a new instance with

packages/database/test/exp/integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { initializeApp, deleteApp } from '@firebase/app-exp';
2020
import { expect } from 'chai';
2121
import { DATABASE_ADDRESS, DATABASE_URL } from '../helpers/util';
2222

23-
import { getDatabase, initializeDatabase } from '../../exp/index';
23+
import { getDatabase } from '../../exp/index';
2424

2525
export function createTestApp() {
2626
return initializeApp({ databaseURL: DATABASE_URL });
@@ -45,7 +45,7 @@ describe('Database Tests', () => {
4545
});
4646

4747
it('Can get database with custom URL', () => {
48-
const db = initializeDatabase(defaultApp, 'http://foo.bar.com');
48+
const db = getDatabase(defaultApp, 'http://foo.bar.com');
4949
expect(db).to.be.ok;
5050
// The URL is assumed to be secure if no port is specified.
5151
expect(db.ref().toString()).to.equal('https://foo.bar.com/');

0 commit comments

Comments
 (0)