feat: add bigint column type support and update dependencies

This commit is contained in:
ArnabChatterjee20k
2026-04-01 09:48:17 +05:30
parent 767a0f6abf
commit 0c38cdabd9
8 changed files with 146 additions and 32 deletions
+1 -1
View File
@@ -20,7 +20,7 @@
},
"dependencies": {
"@ai-sdk/svelte": "^1.1.24",
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@d223f36",
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@863d3e9",
"@appwrite.io/pink-icons": "0.25.0",
"@appwrite.io/pink-icons-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@bfe7ce3",
"@appwrite.io/pink-legacy": "^1.0.3",
+11 -30
View File
@@ -12,8 +12,8 @@ importers:
specifier: ^1.1.24
version: 1.1.24(svelte@5.55.0)(zod@3.25.76)
'@appwrite.io/console':
specifier: https://pkg.vc/-/@appwrite/@appwrite.io/console@83fd10c
version: https://pkg.vc/-/@appwrite/@appwrite.io/console@83fd10c
specifier: https://pkg.vc/-/@appwrite/@appwrite.io/console@863d3e9
version: https://pkg.vc/-/@appwrite/@appwrite.io/console@863d3e9
'@appwrite.io/pink-icons':
specifier: 0.25.0
version: 0.25.0
@@ -75,8 +75,8 @@ importers:
specifier: ^5.1.7
version: 5.1.7
nanotar:
specifier: ^0.1.1
version: 0.1.1
specifier: ^0.3.0
version: 0.3.0
pretty-bytes:
specifier: ^6.1.1
version: 6.1.1
@@ -281,9 +281,9 @@ packages:
'@analytics/type-utils@0.6.4':
resolution: {integrity: sha512-Ou1gQxFakOWLcPnbFVsrPb8g1wLLUZYYJXDPjHkG07+5mustGs5yqACx42UAu4A6NszNN6Z5gGxhyH45zPWRxw==}
'@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@83fd10c':
resolution: {integrity: sha512-Mlq0dfJrcqUNFt+QUmrieHrJSScOUniigt1PL5Xum7QEDgT8Z/mMhG/xUcVfZqXtlF5gS4Sq7n72EB6P/3+kmQ==, tarball: https://pkg.vc/-/@appwrite/@appwrite.io/console@83fd10c}
version: 7.0.0
'@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@863d3e9':
resolution: {integrity: sha512-BJ9wrAI8frqAp9fN89RtJGn0r+RplWJ669s8AoW4JstYsnSe+ewhjBlLZWpFmIMfepz5agCE6G+4g7LXOfqdYg==, tarball: https://pkg.vc/-/@appwrite/@appwrite.io/console@863d3e9}
version: 8.0.0
'@appwrite.io/pink-icons-svelte@2.0.0-RC.1':
resolution: {integrity: sha512-iLFlV55hj8mGuAbmxJGenxN5RaZMmVT4GJb9dv/MP1xBAtYibFq7JvBcxm18qV2KU8c31Rntf+Ub4GL7HwqTYg==}
@@ -935,42 +935,36 @@ packages:
engines: {node: '>= 10.0.0'}
cpu: [arm]
os: [linux]
libc: [glibc]
'@parcel/watcher-linux-arm-musl@2.5.6':
resolution: {integrity: sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg==}
engines: {node: '>= 10.0.0'}
cpu: [arm]
os: [linux]
libc: [musl]
'@parcel/watcher-linux-arm64-glibc@2.5.6':
resolution: {integrity: sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA==}
engines: {node: '>= 10.0.0'}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@parcel/watcher-linux-arm64-musl@2.5.6':
resolution: {integrity: sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA==}
engines: {node: '>= 10.0.0'}
cpu: [arm64]
os: [linux]
libc: [musl]
'@parcel/watcher-linux-x64-glibc@2.5.6':
resolution: {integrity: sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==}
engines: {node: '>= 10.0.0'}
cpu: [x64]
os: [linux]
libc: [glibc]
'@parcel/watcher-linux-x64-musl@2.5.6':
resolution: {integrity: sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==}
engines: {node: '>= 10.0.0'}
cpu: [x64]
os: [linux]
libc: [musl]
'@parcel/watcher-win32-arm64@2.5.6':
resolution: {integrity: sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q==}
@@ -1045,79 +1039,66 @@ packages:
resolution: {integrity: sha512-RzeBwv0B3qtVBWtcuABtSuCzToo2IEAIQrcyB/b2zMvBWVbjo8bZDjACUpnaafaxhTw2W+imQbP2BD1usasK4g==}
cpu: [arm]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm-musleabihf@4.60.0':
resolution: {integrity: sha512-Sf7zusNI2CIU1HLzuu9Tc5YGAHEZs5Lu7N1ssJG4Tkw6e0MEsN7NdjUDDfGNHy2IU+ENyWT+L2obgWiguWibWQ==}
cpu: [arm]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-arm64-gnu@4.60.0':
resolution: {integrity: sha512-DX2x7CMcrJzsE91q7/O02IJQ5/aLkVtYFryqCjduJhUfGKG6yJV8hxaw8pZa93lLEpPTP/ohdN4wFz7yp/ry9A==}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm64-musl@4.60.0':
resolution: {integrity: sha512-09EL+yFVbJZlhcQfShpswwRZ0Rg+z/CsSELFCnPt3iK+iqwGsI4zht3secj5vLEs957QvFFXnzAT0FFPIxSrkQ==}
cpu: [arm64]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-loong64-gnu@4.60.0':
resolution: {integrity: sha512-i9IcCMPr3EXm8EQg5jnja0Zyc1iFxJjZWlb4wr7U2Wx/GrddOuEafxRdMPRYVaXjgbhvqalp6np07hN1w9kAKw==}
cpu: [loong64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-loong64-musl@4.60.0':
resolution: {integrity: sha512-DGzdJK9kyJ+B78MCkWeGnpXJ91tK/iKA6HwHxF4TAlPIY7GXEvMe8hBFRgdrR9Ly4qebR/7gfUs9y2IoaVEyog==}
cpu: [loong64]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-ppc64-gnu@4.60.0':
resolution: {integrity: sha512-RwpnLsqC8qbS8z1H1AxBA1H6qknR4YpPR9w2XX0vo2Sz10miu57PkNcnHVaZkbqyw/kUWfKMI73jhmfi9BRMUQ==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-ppc64-musl@4.60.0':
resolution: {integrity: sha512-Z8pPf54Ly3aqtdWC3G4rFigZgNvd+qJlOE52fmko3KST9SoGfAdSRCwyoyG05q1HrrAblLbk1/PSIV+80/pxLg==}
cpu: [ppc64]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-riscv64-gnu@4.60.0':
resolution: {integrity: sha512-3a3qQustp3COCGvnP4SvrMHnPQ9d1vzCakQVRTliaz8cIp/wULGjiGpbcqrkv0WrHTEp8bQD/B3HBjzujVWLOA==}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-riscv64-musl@4.60.0':
resolution: {integrity: sha512-pjZDsVH/1VsghMJ2/kAaxt6dL0psT6ZexQVrijczOf+PeP2BUqTHYejk3l6TlPRydggINOeNRhvpLa0AYpCWSQ==}
cpu: [riscv64]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-s390x-gnu@4.60.0':
resolution: {integrity: sha512-3ObQs0BhvPgiUVZrN7gqCSvmFuMWvWvsjG5ayJ3Lraqv+2KhOsp+pUbigqbeWqueGIsnn+09HBw27rJ+gYK4VQ==}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-gnu@4.60.0':
resolution: {integrity: sha512-EtylprDtQPdS5rXvAayrNDYoJhIz1/vzN2fEubo3yLE7tfAw+948dO0g4M0vkTVFhKojnF+n6C8bDNe+gDRdTg==}
cpu: [x64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-musl@4.60.0':
resolution: {integrity: sha512-k09oiRCi/bHU9UVFqD17r3eJR9bn03TyKraCrlz5ULFJGdJGi7VOmm9jl44vOJvRJ6P7WuBi/s2A97LxxHGIdw==}
cpu: [x64]
os: [linux]
libc: [musl]
'@rollup/rollup-openbsd-x64@4.60.0':
resolution: {integrity: sha512-1o/0/pIhozoSaDJoDcec+IVLbnRtQmHwPV730+AOD29lHEEo4F5BEUB24H0OBdhbBBDwIOSuf7vgg0Ywxdfiiw==}
@@ -2675,8 +2656,8 @@ packages:
engines: {node: ^18 || >=20}
hasBin: true
nanotar@0.1.1:
resolution: {integrity: sha512-AiJsGsSF3O0havL1BydvI4+wR76sKT+okKRwWIaK96cZUnXqH0uNBOsHlbwZq3+m2BR1VKqHDVudl3gO4mYjpQ==}
nanotar@0.3.0:
resolution: {integrity: sha512-Kv2JYYiCzt16Kt5QwAc9BFG89xfPNBx+oQL4GQXD9nLqPkZBiNaqaCWtwnbk/q7UVsTYevvM1b0UF8zmEI4pCg==}
natural-compare@1.4.0:
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
@@ -3631,7 +3612,7 @@ snapshots:
'@analytics/type-utils@0.6.4': {}
'@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@83fd10c':
'@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@863d3e9':
dependencies:
json-bigint: 1.0.0
@@ -6160,7 +6141,7 @@ snapshots:
nanoid@5.1.7: {}
nanotar@0.1.1: {}
nanotar@0.3.0: {}
natural-compare@1.4.0: {}
+1
View File
@@ -34,6 +34,7 @@ const columnTypes = [
'text',
'mediumtext',
'longtext',
'bigint',
'integer',
'double',
'boolean',
@@ -198,7 +198,7 @@
) {
const stringColumn = column as Models.ColumnString;
return { display: `Size: ${stringColumn.size}` };
} else if (column.type === 'integer' || column.type === 'double') {
} else if (column.type === 'bigint' || column.type === 'integer' || column.type === 'double') {
const numbersColumn = column as Models.ColumnInteger | Models.ColumnFloat;
const { min, max } = numbersColumn;
@@ -0,0 +1,115 @@
<script context="module" lang="ts">
import { page } from '$app/state';
import { sdk } from '$lib/stores/sdk';
import type { Models } from '@appwrite.io/console';
export async function submitBigInt(
databaseId: string,
tableId: string,
key: string,
data: Partial<Models.ColumnInteger>
) {
await sdk.forProject(page.params.region, page.params.project).tablesDB.createBigIntColumn({
databaseId,
tableId,
key,
required: data.required,
min: data.min,
max: data.max,
xdefault: data.default,
array: data.array
});
}
export async function updateBigInt(
databaseId: string,
tableId: string,
data: Partial<Models.ColumnInteger>,
originalKey?: string
) {
await sdk.forProject(page.params.region, page.params.project).tablesDB.updateBigIntColumn({
databaseId,
tableId,
key: originalKey,
required: data.required,
xdefault: data.default,
min: data.min,
max: data.max,
newKey: data.key !== originalKey ? data.key : undefined
});
}
</script>
<script lang="ts">
import { Layout } from '@appwrite.io/pink-svelte';
import { InputNumber } from '$lib/elements/forms';
import { createConservative } from '$lib/helpers/stores';
import RequiredArrayCheckboxes from './requiredArrayCheckboxes.svelte';
export let editing = false;
export let disabled = false;
export let data: Partial<Models.ColumnInteger> = {
required: false,
min: 0,
max: 0,
default: 0,
array: false
};
let savedDefault = data.default;
function handleDefaultState(hideDefault: boolean) {
if (hideDefault) {
savedDefault = data.default;
data.default = null;
} else {
data.default = savedDefault;
}
}
const {
stores: { required, array },
listen
} = createConservative<Partial<Models.ColumnInteger>>({
required: false,
array: false,
...data
});
$: listen(data);
$: handleDefaultState($required || $array);
</script>
<Layout.Stack direction="row" gap="s">
<InputNumber
id="min"
label="Min"
{disabled}
placeholder="Enter size"
bind:value={data.min}
required={editing} />
<InputNumber
id="max"
label="Max"
{disabled}
placeholder="Enter size"
bind:value={data.max}
required={editing} />
</Layout.Stack>
<InputNumber
id="default"
label="Default value"
placeholder="Enter value"
min={data.min}
max={data.max}
bind:value={data.default}
disabled={data.required || data.array || disabled}
nullable={(!data.required && !data.array) || disabled} />
<RequiredArrayCheckboxes
{editing}
{disabled}
bind:array={data.array}
bind:required={data.required} />
@@ -4,6 +4,7 @@ import Boolean, { submitBoolean, updateBoolean } from './boolean.svelte';
import Email, { submitEmail, updateEmail } from './email.svelte';
import Enum, { submitEnum, updateEnum } from './enum.svelte';
import Float, { submitFloat, updateFloat } from './float.svelte';
import BigInt, { submitBigInt, updateBigInt } from './bigint.svelte';
import Integer, { submitInteger, updateInteger } from './integer.svelte';
import Ip, { submitIp, updateIp } from './ip.svelte';
import String, { submitString, updateString } from './string.svelte';
@@ -41,6 +42,7 @@ export type Option = {
| 'Mediumtext'
| 'Longtext'
| 'Varchar'
| 'BigInt'
| 'Integer'
| 'Float'
| 'Boolean'
@@ -62,6 +64,7 @@ export type Option = {
| 'mediumtext'
| 'longtext'
| 'varchar'
| 'bigint'
| 'integer'
| 'double'
| 'boolean'
@@ -125,6 +128,15 @@ export const columnOptions: Option[] = [
update: updateVarchar,
icon: IconText
},
{
name: 'BigInt',
sentenceName: 'bigint',
component: BigInt,
type: 'bigint',
create: submitBigInt,
update: updateBigInt,
icon: IconHashtag
},
{
name: 'Integer',
sentenceName: 'integer',
@@ -24,6 +24,7 @@
| Models.ColumnText
| Models.ColumnMediumtext
| Models.ColumnLongtext
| Models.ColumnBigint
| Models.ColumnInteger
| Models.ColumnFloat
| Models.ColumnBoolean
@@ -51,6 +52,7 @@
if (!trimmed) return null;
switch (column.type) {
case 'bigint':
case 'integer': {
const int = parseInt(trimmed, 10);
return isNaN(int) ? null : int;
@@ -122,6 +124,7 @@
const getPlaceholder = () => {
if (!array) {
switch (column.type) {
case 'bigint':
case 'integer':
return 'Enter integer';
case 'double':
@@ -134,6 +137,7 @@
}
} else {
switch (column.type) {
case 'bigint':
case 'integer':
return 'Enter integers separated by commas';
case 'double':
@@ -332,6 +332,7 @@
switch (type) {
case 'string':
return IconText;
case 'bigint':
case 'double':
case 'integer':
return IconHashtag;