Skip to content

Commit dd58bf7

Browse files
authored
Merge pull request #190 from appwrite/dev
Fix refs
2 parents 28a8e86 + 802621c commit dd58bf7

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ program
138138
.addCommand(proxy)
139139
.addCommand(sites)
140140
.addCommand(storage)
141-
.addCommand(tablesdb)
141+
.addCommand(tablesDB)
142142
.addCommand(teams)
143143
.addCommand(tokens)
144144
.addCommand(users)

lib/commands/databases.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2330,7 +2330,7 @@ databases
23302330

23312331
databases
23322332
.command(`create`)
2333-
.description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-database' instead] Create a new Database. `)
2333+
.description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create' instead] Create a new Database. `)
23342334
.requiredOption(`--database-id <database-id>`, `Unique Id. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
23352335
.requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
23362336
.option(`--enabled [value]`, `Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))

lib/commands/pull.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { projectsGet } = require("./projects");
99
const { functionsList, functionsGetDeploymentDownload, functionsListDeployments } = require("./functions");
1010
const { sitesList, sitesGetDeploymentDownload, sitesListDeployments } = require("./sites");
1111
const { databasesGet, databasesListCollections, databasesList } = require("./databases");
12-
const { gridsListDatabases, gridsGetDatabase, gridsListTables } = require("./grids");
12+
const { tablesDBList, tablesDBget, tablesDBListTables } = require("./tables-db");
1313
const { storageListBuckets } = require("./storage");
1414
const { localConfig } = require("../config");
1515
const { paginate } = require("../paginate");
@@ -343,7 +343,7 @@ const pullTable = async () => {
343343
log("Fetching tables ...");
344344
let total = 0;
345345

346-
const fetchResponse = await gridsListDatabases({
346+
const fetchResponse = await tablesDBList({
347347
queries: [JSON.stringify({ method: 'limit', values: [1] })],
348348
parseOutput: false
349349
});
@@ -357,14 +357,14 @@ const pullTable = async () => {
357357

358358
if (databases.length === 0) {
359359
if (cliConfig.all) {
360-
databases = (await paginate(gridsListDatabases, { parseOutput: false }, 100, 'databases')).databases.map(database => database.$id);
360+
databases = (await paginate(tablesDBList, { parseOutput: false }, 100, 'databases')).databases.map(database => database.$id);
361361
} else {
362362
databases = (await inquirer.prompt(questionsPullCollection)).databases;
363363
}
364364
}
365365

366366
for (const databaseId of databases) {
367-
const database = await gridsGetDatabase({
367+
const database = await tablesDBget({
368368
databaseId,
369369
parseOutput: false
370370
});
@@ -374,7 +374,7 @@ const pullTable = async () => {
374374

375375
localConfig.addDatabase(database);
376376

377-
const { tables } = await paginate(gridsListTables, {
377+
const { tables } = await paginate(tablesDBListTables, {
378378
databaseId,
379379
parseOutput: false
380380
}, 100, 'tables');

lib/commands/push.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ const {
5050
databasesUpdateCollection
5151
} = require("./databases");
5252
const {
53-
gridsGetDatabase,
54-
gridsGetTable
55-
} = require("./grids");
53+
tablesDBGet,
54+
tablesDBGetTable
55+
} = require("./tables-db");
5656
const {
5757
storageGetBucket, storageUpdateBucket, storageCreateBucket
5858
} = require("./storage");
@@ -1714,7 +1714,7 @@ const pushTable = async ({ returnOnZero, attempts } = { returnOnZero: false }) =
17141714
const localDatabase = localConfig.getDatabase(databaseId);
17151715

17161716
try {
1717-
const database = await gridsGetDatabase({
1717+
const database = await tablesDBGet({
17181718
databaseId: databaseId,
17191719
parseOutput: false,
17201720
});
@@ -1740,13 +1740,13 @@ const pushTable = async ({ returnOnZero, attempts } = { returnOnZero: false }) =
17401740
}));
17411741

17421742

1743-
if (!(await approveChanges(tables, gridsGetTable, KeysTable, 'tableId', 'tables', ['columns', 'indexes'], 'databaseId', 'databaseId',))) {
1743+
if (!(await approveChanges(tables, tablesDBGetTable, KeysTable, 'tableId', 'tables', ['columns', 'indexes'], 'databaseId', 'databaseId',))) {
17441744
return;
17451745
}
17461746
// Parallel collection actions
17471747
await Promise.all(tables.map(async (table) => {
17481748
try {
1749-
const remoteTable = await gridsGetTable({
1749+
const remoteTable = await tablesDBGetTable({
17501750
databaseId: table['databaseId'],
17511751
tableId: table['$id'],
17521752
parseOutput: false,

lib/questions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ const questionsPullResources = [
255255
choices: [
256256
{ name: `Settings ${chalk.blackBright(`(Project)`)}`, value: 'settings' },
257257
{ name: `Functions ${chalk.blackBright(`(Deployment)`)}`, value: 'functions' },
258-
{ name: `Tables ${chalk.blackBright(`(Grids)`)}`, value: 'tables' },
258+
{ name: `Tables ${chalk.blackBright(`(TablesDB)`)}`, value: 'tables' },
259259
{ name: `Buckets ${chalk.blackBright(`(Storage)`)}`, value: 'buckets' },
260260
{ name: `Teams ${chalk.blackBright(`(Auth)`)}`, value: 'teams' },
261261
{ name: `Topics ${chalk.blackBright(`(Messaging)`)}`, value: 'messages' },
@@ -667,7 +667,7 @@ const questionsPushResources = [
667667
choices: [
668668
{ name: `Settings ${chalk.blackBright(`(Project)`)}`, value: 'settings' },
669669
{ name: `Functions ${chalk.blackBright(`(Deployment)`)}`, value: 'functions' },
670-
{ name: `Tables ${chalk.blackBright(`(Grids)`)}`, value: 'tables' },
670+
{ name: `Tables ${chalk.blackBright(`(TablesDB)`)}`, value: 'tables' },
671671
{ name: `Buckets ${chalk.blackBright(`(Storage)`)}`, value: 'buckets' },
672672
{ name: `Teams ${chalk.blackBright(`(Auth)`)}`, value: 'teams' },
673673
{ name: `Topics ${chalk.blackBright(`(Messaging)`)}`, value: 'messages' },

0 commit comments

Comments
 (0)