refactor: create index.js for aql directory (#68)
This commit is contained in:
parent
4be86c3d42
commit
0fcfffea57
17 changed files with 28 additions and 23 deletions
|
@ -4,7 +4,7 @@ import os from 'os';
|
|||
import * as sqlite from '../src/platform/server/sqlite';
|
||||
import * as db from '../src/server/db';
|
||||
import { batchMessages, setSyncingMode } from '../src/server/sync';
|
||||
import { runQuery } from '../src/server/aql/schema/run-query';
|
||||
import { runQuery } from '../src/server/aql';
|
||||
import asyncStorage from '../src/platform/server/asyncStorage';
|
||||
import { makeChild } from '../src/shared/transactions';
|
||||
import q from '../src/shared/query';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env actual-cli-runner.js
|
||||
const { schema } = require('../src/server/aql/schema');
|
||||
const { schema } = require('../src/server/aql');
|
||||
const table = process.argv[3];
|
||||
|
||||
if (table == null || table === 'transactions') {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import fc from 'fast-check';
|
||||
import { schema } from '../server/aql/schema';
|
||||
import { schema } from '../server/aql';
|
||||
import { addDays } from '../shared/months';
|
||||
|
||||
function typeArbitrary(typeDesc, name) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import * as budget from '../server/budget/base';
|
|||
import * as db from '../server/db';
|
||||
import * as prefs from '../server/prefs';
|
||||
import * as budgetActions from '../server/budget/actions';
|
||||
import { runQuery as aqlQuery } from '../server/aql/schema/run-query';
|
||||
import { runQuery as aqlQuery } from '../server/aql';
|
||||
import { batchMessages, setSyncingMode } from '../server/sync';
|
||||
import { runHandler, runMutator } from '../server/mutators';
|
||||
import { addTransactions } from '../server/accounts/sync';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import csvStringify from 'csv-stringify/lib/sync';
|
||||
import { runQuery as aqlQuery } from '../aql/schema/run-query';
|
||||
import { runQuery as aqlQuery } from '../aql';
|
||||
import { integerToAmount } from '../../shared/util';
|
||||
|
||||
export async function exportToCSV(
|
||||
|
|
|
@ -21,7 +21,7 @@ import { requiredFields, toDateRepr } from '../models';
|
|||
import { currentDay } from '../../shared/months';
|
||||
import { partitionByField, fastSetMerge } from '../../shared/util';
|
||||
import { setSyncingMode, batchMessages } from '../sync';
|
||||
import { schemaConfig } from '../aql/schema';
|
||||
import { schemaConfig } from '../aql';
|
||||
|
||||
// TODO: Detect if it looks like the user is creating a rename rule
|
||||
// and prompt to create it in the pre phase instead
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
migrateOldRules
|
||||
} from './transaction-rules';
|
||||
import { loadMappings } from '../db/mappings';
|
||||
import { runQuery } from '../aql/schema/run-query';
|
||||
import { runQuery } from '../aql';
|
||||
import q from '../../shared/query';
|
||||
|
||||
// TODO: write tests to make sure payee renaming is "pre" and category
|
||||
|
|
|
@ -20,7 +20,7 @@ import { setSyncingMode, batchMessages } from './sync';
|
|||
import { getClock } from './crdt';
|
||||
import { runMutator } from './mutators';
|
||||
import { integerToAmount } from '../shared/util';
|
||||
import { runQuery as aqlQuery } from './aql/schema/run-query';
|
||||
import { runQuery as aqlQuery } from './aql';
|
||||
import q from '../shared/query';
|
||||
|
||||
const connection = require('../platform/server/connection');
|
||||
|
|
10
packages/loot-core/src/server/aql/index.js
Normal file
10
packages/loot-core/src/server/aql/index.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
export {
|
||||
convertForInsert,
|
||||
convertForUpdate,
|
||||
convertFromSelect,
|
||||
convertInputType,
|
||||
} from './schema-helpers';
|
||||
export { compileQuery } from "./compiler";
|
||||
export { makeViews } from "./views";
|
||||
export { schema, schemaConfig } from "./schema";
|
||||
export { runQuery, runCompiledQuery } from "./schema/run-query";
|
|
@ -2,7 +2,7 @@ import LRU from 'lru-cache';
|
|||
import * as sqlite from '../../platform/server/sqlite';
|
||||
import fs from '../../platform/server/fs';
|
||||
import { sendMessages, batchMessages } from '../sync';
|
||||
import { schema, schemaConfig } from '../aql/schema';
|
||||
import { schema, schemaConfig } from '../aql';
|
||||
import {
|
||||
accountModel,
|
||||
categoryModel,
|
||||
|
@ -23,7 +23,7 @@ import {
|
|||
convertForInsert,
|
||||
convertForUpdate,
|
||||
convertFromSelect
|
||||
} from '../aql/schema-helpers';
|
||||
} from '../aql';
|
||||
import { shoveSortOrders, SORT_INCREMENT } from './sort';
|
||||
|
||||
export { toDateRepr, fromDateRepr } from '../models';
|
||||
|
|
|
@ -64,9 +64,8 @@ import * as tracking from './tracking/events';
|
|||
import { get, post } from './post';
|
||||
import { APIError, TransactionError, PostError, RuleError } from './errors';
|
||||
import { createTestBudget } from '../mocks/budget';
|
||||
import { runQuery as aqlQuery } from './aql/schema/run-query';
|
||||
import { Query } from '../shared/query';
|
||||
import q from '../shared/query';
|
||||
import { runQuery as aqlQuery } from './aql';
|
||||
import q, { Query } from '../shared/query';
|
||||
import app from './main-app';
|
||||
|
||||
// Apps
|
||||
|
|
|
@ -4,7 +4,7 @@ import { createApp } from '../app';
|
|||
import * as db from '../db';
|
||||
import * as prefs from '../prefs';
|
||||
import { toDateRepr } from '../models';
|
||||
import { runQuery as aqlQuery } from '../aql/schema/run-query';
|
||||
import { runQuery as aqlQuery } from '../aql';
|
||||
import { dayFromDate, currentDay, parseDate } from '../../shared/months';
|
||||
import q from '../../shared/query';
|
||||
import {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { runQuery as aqlQuery } from '../aql/schema/run-query';
|
||||
import { runQuery as aqlQuery } from '../aql';
|
||||
import q from '../../shared/query';
|
||||
import { loadRules, updateRule } from '../accounts/transaction-rules';
|
||||
import { loadMappings } from '../db/mappings';
|
||||
|
|
|
@ -3,7 +3,7 @@ import * as db from '../db';
|
|||
import { Schedule as RSchedule } from '../util/rschedule';
|
||||
import { groupBy } from '../../shared/util';
|
||||
import { fromDateRepr } from '../models';
|
||||
import { runQuery as aqlQuery } from '../aql/schema/run-query';
|
||||
import { runQuery as aqlQuery } from '../aql';
|
||||
import q from '../../shared/query';
|
||||
import { getApproxNumberThreshold } from '../../shared/rules';
|
||||
import { recurConfigToRSchedule } from '../../shared/schedules';
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import mitt from 'mitt';
|
||||
import { schema, schemaConfig } from '../aql/schema';
|
||||
import { compileQuery } from '../aql/compiler';
|
||||
import { runCompiledQuery } from '../aql/schema/run-query';
|
||||
import { compileQuery, runCompiledQuery, schema, schemaConfig } from '../aql';
|
||||
|
||||
const Graph = require('./graph-data-structure');
|
||||
const { unresolveName, resolveName } = require('./util');
|
||||
|
|
|
@ -3,9 +3,8 @@ import * as db from '../db';
|
|||
import { listen, unlisten } from './migrate';
|
||||
import { addSyncListener, sendMessages } from './index';
|
||||
import { execTracer } from '../../shared/test-helpers';
|
||||
import { schema, schemaConfig } from '../aql/schema';
|
||||
import { convertInputType, schema, schemaConfig } from '../aql';
|
||||
import arbs from '../../mocks/arbitrary-schema';
|
||||
import { convertInputType } from '../aql/schema-helpers';
|
||||
|
||||
beforeEach(() => {
|
||||
listen();
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import md5 from 'md5';
|
||||
import * as migrations from './migrate/migrations';
|
||||
import * as db from './db';
|
||||
import { schema, schemaConfig } from './aql/schema';
|
||||
import { makeViews } from './aql/views';
|
||||
import { schema, schemaConfig, makeViews } from './aql';
|
||||
|
||||
// Managing the init/update process
|
||||
|
||||
|
|
Loading…
Reference in a new issue