Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
39fa559
Errors for showing table columns
insmac Oct 10, 2024
ce211e6
submodule update
insmac Oct 10, 2024
cfd9cc9
Feat: Auto refresh toggle
insmac Oct 11, 2024
1ddff57
Auto refresh toggle: fixes
insmac Oct 11, 2024
a2ea4b8
Add table selection UI
insmac Oct 14, 2024
983838a
fix: icon jumping
insmac Oct 14, 2024
d0cffa3
Animation for table selection
insmac Oct 17, 2024
891793f
Support errors in schema copy
insmac Oct 18, 2024
a894eab
schema copy: cleanup
insmac Oct 18, 2024
cd18b24
Table selection in toolbar
insmac Oct 18, 2024
0a0b73e
small styling tweaks
insmac Oct 18, 2024
50315ed
Update Schema tests
insmac Oct 21, 2024
245d4ed
submodule update
insmac Oct 21, 2024
482d116
Add selection tests
insmac Oct 21, 2024
7ce38d5
Merge branch 'main' into web-console/table-queries-error-support
insmac Oct 21, 2024
15c9870
change active button state app-wide
insmac Oct 21, 2024
f5f2c87
Redesign the selection toolbar
insmac Oct 22, 2024
718511f
Update buttons
insmac Oct 22, 2024
cef95ad
Update tests
insmac Oct 22, 2024
5eb42b0
submodule update
insmac Oct 22, 2024
eb676a5
Merge branch 'main' into web-console/table-queries-error-support
insmac Oct 22, 2024
f1033f9
Disable `select` mode when no tables
insmac Oct 22, 2024
784b11a
Fix: auto refresh toggle
insmac Oct 23, 2024
15fa01b
Adjust buttons
insmac Oct 23, 2024
785c637
Update freeze left column button in the grid
insmac Oct 23, 2024
453b84d
submodule update
insmac Oct 23, 2024
9a326ec
save listener state
insmac Oct 23, 2024
ac7f5a3
save state between react and listener code
insmac Oct 23, 2024
18c5a46
increase timeout for cancel SQL button to appear in the status panel
bluestreak01 Oct 23, 2024
8dc1e97
icon spacing (0)
bluestreak01 Oct 23, 2024
0d01270
Update styling of the toggle
insmac Oct 23, 2024
0741512
submodule update
insmac Oct 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/browser-tests/cypress/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,9 @@ Cypress.Commands.add("loadConsoleWithAuth", (clearWarnings) => {
});

Cypress.Commands.add("refreshSchema", () => {
cy.getByDataHook("schema-settings-button").click();
cy.getByDataHook("schema-refresh").click();
// toggle between auto-refresh modes to trigger a schema refresh
cy.getByDataHook("schema-auto-refresh-button").click();
cy.getByDataHook("schema-auto-refresh-button").click();
});

Cypress.Commands.add("getEditorTabs", () => {
Expand Down
48 changes: 48 additions & 0 deletions packages/browser-tests/cypress/integration/console/schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,54 @@ describe("questdb schema with suspended tables with Linux OS error codes", () =>
});
});

describe("table select UI", () => {
before(() => {
cy.loadConsoleWithAuth();

tables.forEach((table) => {
cy.createTable(table);
});
cy.refreshSchema();
});
beforeEach(() => {
cy.loadConsoleWithAuth();
});

it("should show select ui on click", () => {
cy.getByDataHook("schema-select-button").click();
cy.getByDataHook("schema-copy-to-clipboard-button").should("be.visible");
cy.getByDataHook("schema-copy-to-clipboard-button").should("be.disabled");
cy.getByDataHook("schema-select-all-button").should("be.visible");
});

it("should select and deselect tables", () => {
cy.getByDataHook("schema-select-button").click();
cy.getByDataHook("schema-table-title").contains("btc_trades").click();
cy.getByDataHook("schema-table-title")
.contains("chicago_weather_stations")
.click();
cy.getByDataHook("schema-copy-to-clipboard-button")
.should("not.be.disabled")
.click();
// Electron only!
if (Cypress.isBrowser("electron")) {
["btc_trades", "chicago_weather_stations"].forEach((table) => {
cy.window()
.its("navigator.clipboard")
.then((clip) => clip.readText())
.should("contain", `CREATE TABLE '${table}'`);
});
}
});

after(() => {
cy.loadConsoleWithAuth();
tables.forEach((table) => {
cy.dropTable(table);
});
});
});

describe("questdb schema in read-only mode", () => {
before(() => {
cy.intercept(
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-tests/questdb
Submodule questdb updated 82 files
+1 −0 .gitignore
+4 −7 README.md
+1 −1 benchmarks/pom.xml
+1 −1 compat/pom.xml
+2 −2 core/pom.xml
+1 −0 core/src/main/c/share/dedup_comparers.h
+17 −8 core/src/main/c/share/files.c
+2 −3 core/src/main/c/share/txn_board.cpp
+8 −3 core/src/main/java/io/questdb/ServerMain.java
+80 −424 core/src/main/java/io/questdb/cairo/CairoEngine.java
+46 −12 core/src/main/java/io/questdb/cairo/DatabaseCheckpointAgent.java
+529 −0 core/src/main/java/io/questdb/cairo/MetadataCache.java
+18 −23 core/src/main/java/io/questdb/cairo/MetadataCacheReader.java
+70 −0 core/src/main/java/io/questdb/cairo/MetadataCacheWriter.java
+9 −2 core/src/main/java/io/questdb/cairo/TableConverter.java
+73 −60 core/src/main/java/io/questdb/cairo/TableReader.java
+114 −20 core/src/main/java/io/questdb/cairo/TableWriter.java
+31 −19 core/src/main/java/io/questdb/cairo/TxnScoreboard.java
+9 −0 core/src/main/java/io/questdb/cairo/vm/MemoryCMARWImpl.java
+6 −0 core/src/main/java/io/questdb/cairo/vm/MemoryCMRImpl.java
+4 −0 core/src/main/java/io/questdb/cairo/vm/NullMemoryCMR.java
+2 −0 core/src/main/java/io/questdb/cairo/vm/api/MemoryCMR.java
+13 −2 core/src/main/java/io/questdb/cairo/wal/seq/TableSequencerImpl.java
+40 −6 core/src/main/java/io/questdb/cutlass/http/processors/JsonQueryProcessorState.java
+15 −9 core/src/main/java/io/questdb/cutlass/pgwire/PGConnectionContext.java
+40 −4 core/src/main/java/io/questdb/cutlass/text/ParallelCsvFileImporter.java
+5 −0 core/src/main/java/io/questdb/griffin/SqlCodeGenerator.java
+70 −6 core/src/main/java/io/questdb/griffin/SqlCompilerImpl.java
+38 −28 core/src/main/java/io/questdb/griffin/engine/functions/catalogue/AllTablesFunctionFactory.java
+72 −50 core/src/main/java/io/questdb/griffin/engine/functions/catalogue/InformationSchemaColumnsFunctionFactory.java
+73 −55 core/src/main/java/io/questdb/griffin/engine/functions/catalogue/PgAttributeFunctionFactory.java
+40 −32 core/src/main/java/io/questdb/griffin/engine/functions/catalogue/TablesFunctionFactory.java
+22 −22 core/src/main/java/io/questdb/griffin/engine/functions/groupby/AbstractCovarGroupByFunction.java
+0 −180 core/src/main/java/io/questdb/griffin/engine/functions/groupby/CorrGroupByFunction.java
+194 −0 core/src/main/java/io/questdb/griffin/engine/functions/groupby/CorrGroupByFunctionFactory.java
+1 −1 core/src/main/java/io/questdb/griffin/engine/functions/groupby/CovarPopGroupByFunction.java
+0 −51 core/src/main/java/io/questdb/griffin/engine/functions/groupby/CovarSampleGroupByFunction.java
+63 −0 core/src/main/java/io/questdb/griffin/engine/functions/groupby/CovarSampleGroupByFunctionFactory.java
+205 −0 core/src/main/java/io/questdb/griffin/engine/functions/groupby/RegressionSlopeFunctionFactory.java
+0 −52 core/src/main/java/io/questdb/griffin/engine/functions/groupby/StdDevPopGroupByFunction.java
+59 −0 core/src/main/java/io/questdb/griffin/engine/functions/groupby/StdDevPopGroupByFunctionFactory.java
+0 −52 core/src/main/java/io/questdb/griffin/engine/functions/groupby/StdDevSampleGroupByFunction.java
+58 −0 core/src/main/java/io/questdb/griffin/engine/functions/groupby/StdDevSampleGroupByFunctionFactory.java
+59 −0 core/src/main/java/io/questdb/griffin/engine/functions/groupby/VarPopGroupByFunctionFactory.java
+0 −51 core/src/main/java/io/questdb/griffin/engine/functions/groupby/VarSampleGroupByFunction.java
+60 −0 core/src/main/java/io/questdb/griffin/engine/functions/groupby/VarSampleGroupByFunctionFactory.java
+6 −3 core/src/main/java/io/questdb/griffin/engine/functions/table/HydrateTableMetadataFunctionFactory.java
+20 −7 core/src/main/java/io/questdb/griffin/engine/table/ShowColumnsRecordCursorFactory.java
+4 −0 core/src/main/java/io/questdb/std/CharSequenceObjHashMap.java
+3 −0 core/src/main/java/module-info.java
+2 −0 core/src/main/resources/META-INF/services/io.questdb.griffin.FunctionFactory
+ core/src/main/resources/io/questdb/bin/darwin-aarch64/libquestdb.dylib
+ core/src/main/resources/io/questdb/bin/darwin-x86-64/libquestdb.dylib
+ core/src/main/resources/io/questdb/bin/linux-aarch64/libquestdb.so
+ core/src/main/resources/io/questdb/bin/linux-x86-64/libquestdb.so
+ core/src/main/resources/io/questdb/bin/windows-x86-64/libquestdb.dll
+95 −13 core/src/test/java/io/questdb/test/AbstractCairoTest.java
+12 −1 core/src/test/java/io/questdb/test/CreateTableTestUtils.java
+94 −51 core/src/test/java/io/questdb/test/FilesTest.java
+0 −610 core/src/test/java/io/questdb/test/cairo/CairoMetadataCacheTest.java
+803 −0 core/src/test/java/io/questdb/test/cairo/MetadataCacheTest.java
+8 −5 core/src/test/java/io/questdb/test/cairo/TxnScoreboardTest.java
+60 −1 core/src/test/java/io/questdb/test/cutlass/http/IODispatcherTest.java
+31 −44 core/src/test/java/io/questdb/test/cutlass/pgwire/PGJobContextTest.java
+166 −77 core/src/test/java/io/questdb/test/griffin/CheckpointTest.java
+115 −5 core/src/test/java/io/questdb/test/griffin/O3SplitPartitionTest.java
+74 −0 core/src/test/java/io/questdb/test/griffin/ParallelGroupByFuzzTest.java
+46 −0 core/src/test/java/io/questdb/test/griffin/SqlCompilerImplTest.java
+36 −8 ...st/java/io/questdb/test/griffin/engine/functions/catalogue/InformationSchemaColumnsFunctionFactoryTest.java
+5 −9 core/src/test/java/io/questdb/test/griffin/engine/functions/catalogue/TablesFunctionFactoryTest.java
+142 −0 core/src/test/java/io/questdb/test/griffin/engine/functions/finance/RegressionSlopeFunctionFactoryTest.java
+160 −21 core/src/test/java/io/questdb/test/griffin/engine/functions/groupby/CorrGroupByFunctionFactoryTest.java
+1 −1 core/src/test/java/io/questdb/test/griffin/wal/DedupInsertFuzzTest.java
+68 −34 core/src/test/java/io/questdb/test/tools/TestUtils.java
+32 −0 core/src/test/resources/sqllogictest/test/sql/test_corr.test
+84 −0 core/src/test/resources/sqllogictest/test/sql/test_covar.test
+36 −0 core/src/test/resources/sqllogictest/test/sql/test_regression.test
+134 −0 core/src/test/resources/sqllogictest/test/sql/test_stddev.test
+103 −0 core/src/test/resources/sqllogictest/test/sql/test_var.test
+1 −1 examples/pom.xml
+1 −1 pom.xml
+1 −1 utils/pom.xml
13 changes: 5 additions & 8 deletions packages/react-components/src/components/Button/skin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type ColorShape = {
white: string;
inherit: string;
tooltipBackground: string;
offWhite: string;
};

type Color = keyof ColorShape;
Expand All @@ -42,7 +43,7 @@ export const skins = [
"transparent",
] as const;

export type Skin = typeof skins[number];
export type Skin = (typeof skins)[number];

const themes: {
[key in Skin]: {
Expand Down Expand Up @@ -125,16 +126,16 @@ const themes: {
normal: {
background: "transparent",
border: "transparent",
color: "foreground",
color: "offWhite",
},
hover: {
background: "comment",
border: "transparent",
color: "foreground",
color: "offWhite",
},
disabled: {
background: "transparent",
border: "gray1",
border: "transparent",
color: "gray1",
},
},
Expand Down Expand Up @@ -165,10 +166,6 @@ export const makeSkin = (skin: Skin) => {
color: ${getColor(theme.normal.color)};
border-color: ${getColor(theme.normal.border)};

&:focus {
box-shadow: inset 0 0 0 1px ${getColor("foreground")};
}

&:hover:not([disabled]) {
background: ${getColor(theme.hover.background)};
color: ${getColor(theme.hover.color)};
Expand Down
2 changes: 2 additions & 0 deletions packages/react-components/src/theme/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export type Color = {
white: string;
inherit: string;
tooltipBackground: string;
offWhite: string;
};

export const color: Color = {
Expand All @@ -48,4 +49,5 @@ export const color: Color = {
white: "#fafafa",
inherit: "inherit",
tooltipBackground: "#6272a4",
offWhite: "#bdbdbd",
};
2 changes: 1 addition & 1 deletion packages/web-console/src/components/ToggleButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const baseStyles = css<Props>`
${bezierTransition};
${({ disabled }) => disabled && "cursor: default; pointer-events: none;"};
color: ${({ selected, theme }) =>
theme.color[selected ? "foreground" : "offWhite"]};
theme.color[selected ? "green" : "offWhite"]};

svg + span,
img + span {
Expand Down
2 changes: 1 addition & 1 deletion packages/web-console/src/modules/EventBus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class EventBus {

unsubscribe<T extends any>(
eventType: EventType,
handler: (eventPayload?: T) => void,
handler?: (eventPayload?: T) => void,
): void {
this.emitter.off(eventType, handler)
}
Expand Down
13 changes: 13 additions & 0 deletions packages/web-console/src/providers/LocalStorageProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const defaultConfig: LocalConfig = {
editorSplitterBasis: 350,
resultsSplitterBasis: 350,
exampleQueriesVisited: false,
autoRefreshTables: true,
}

type ContextProps = {
Expand All @@ -53,6 +54,7 @@ type ContextProps = {
resultsSplitterBasis: number
updateSettings: (key: StoreKey, value: SettingsType) => void
exampleQueriesVisited: boolean
autoRefreshTables: boolean
}

const defaultValues: ContextProps = {
Expand All @@ -63,6 +65,7 @@ const defaultValues: ContextProps = {
resultsSplitterBasis: 350,
updateSettings: (key: StoreKey, value: SettingsType) => undefined,
exampleQueriesVisited: false,
autoRefreshTables: true,
}

export const LocalStorageContext = createContext<ContextProps>(defaultValues)
Expand Down Expand Up @@ -96,6 +99,12 @@ export const LocalStorageProvider = ({
getValue(StoreKey.EXAMPLE_QUERIES_VISITED) === "true",
)

const [autoRefreshTables, setAutoRefreshTables] = useState<boolean>(
getValue(StoreKey.AUTO_REFRESH_TABLES)
? getValue(StoreKey.AUTO_REFRESH_TABLES) === "true"
: defaultConfig.autoRefreshTables,
)

const updateSettings = (key: StoreKey, value: SettingsType) => {
setValue(key, value.toString())
refreshSettings(key)
Expand Down Expand Up @@ -126,6 +135,9 @@ export const LocalStorageProvider = ({
parseInteger(value, defaultConfig.resultsSplitterBasis),
)
break
case StoreKey.AUTO_REFRESH_TABLES:
setAutoRefreshTables(value === "true")
break
}
}

Expand All @@ -139,6 +151,7 @@ export const LocalStorageProvider = ({
resultsSplitterBasis,
updateSettings,
exampleQueriesVisited,
autoRefreshTables,
}}
>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ export type LocalConfig = {
editorSplitterBasis: number
resultsSplitterBasis: number
exampleQueriesVisited: boolean
autoRefreshTables: boolean
}
3 changes: 2 additions & 1 deletion packages/web-console/src/scenes/Console/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const Console = () => {
: 0,
)
}}
selected={resultsSplitterBasis !== 0}
selected={editorSplitterBasis !== 0}
>
<Database2 size={BUTTON_ICON_SIZE} />
</Navigation>
Expand All @@ -167,6 +167,7 @@ const Console = () => {
<Allotment.Pane
preferredSize={editorSplitterBasis}
visible={editorSplitterBasis !== 0 && !sm}
minSize={250}
>
<Schema />
</Allotment.Pane>
Expand Down
40 changes: 24 additions & 16 deletions packages/web-console/src/scenes/Editor/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ import { Menu as _MenuIcon } from "@styled-icons/remix-fill"
import { CornerDownLeft } from "@styled-icons/evaicons-solid"

import {
ErrorButton,
PaneMenu,
PopperToggle,
SecondaryButton,
SuccessButton,
TransitionDuration,
TransparentButton,
useKeyPress,
Expand All @@ -49,6 +46,7 @@ import { useLocalStorage } from "../../../providers/LocalStorageProvider"
import { StoreKey } from "../../../utils/localStorage/types"
import { DocSearch } from "@docsearch/react"
import { useSettings } from "../../../providers"
import { Button } from "@questdb/react-components"

import "@docsearch/css"

Expand All @@ -68,15 +66,15 @@ const Separator = styled.div`
flex: 1;
`

const QueryPickerButton = styled(SecondaryButton)<{
firstTimeVisitor: boolean
const QueryPickerButton = styled(Button)<{
$firstTimeVisitor: boolean
}>`
position: relative;
margin: 0 1rem;
flex: 0 0 auto;

${({ firstTimeVisitor }) =>
firstTimeVisitor &&
${({ $firstTimeVisitor }) =>
$firstTimeVisitor &&
`&:after {
border-radius: 50%;
content: "";
Expand Down Expand Up @@ -187,7 +185,10 @@ const Menu = () => {
active={queriesPopperActive}
onToggle={handleQueriesToggle}
trigger={
<QueryPickerButton firstTimeVisitor={!exampleQueriesVisited}>
<QueryPickerButton
skin="secondary"
$firstTimeVisitor={!exampleQueriesVisited}
>
<Add size="18px" />
<span>Example queries</span>
</QueryPickerButton>
Expand All @@ -203,23 +204,30 @@ const Menu = () => {
<Separator />

{running.value && (
<ErrorButton onClick={handleClick}>
<Stop size="18px" />
<span>Cancel</span>
</ErrorButton>
<Button
skin="error"
onClick={handleClick}
prefixIcon={<Stop size="18px" />}
>
Cancel
</Button>
)}

{!running.value && (
<SuccessButton title="Ctrl+Enter" onClick={handleClick}>
<Play size="18px" />
<span>Run</span>
<Button
skin="success"
title="Ctrl+Enter"
onClick={handleClick}
prefixIcon={<Play size="18px" />}
>
Run
<RunShortcut>
<Key>{ctrlCmd}</Key>
<Key>
<CornerDownLeft size="16px" />
</Key>
</RunShortcut>
</SuccessButton>
</Button>
)}

<MenuItems>
Expand Down
2 changes: 1 addition & 1 deletion packages/web-console/src/scenes/Editor/Monaco/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ const MonacoEditor = () => {
}),
)
}
}, 250)
}, 1000)

void quest
.queryRaw(request.query, { limit: "0,1000", explain: true })
Expand Down
Loading