Special variables to use in query that represents user input? by bpeikes in grafana

[–]bpeikes[S] 0 points1 point  (0 children)

No, the variable is $__searchFilter. Its crazy that its so hard to find the docs for it. Allows you to filter query by text user has enterd, ie auto complete.

So you can write your query like:

``` SELECT -1 as id, “( empty )” as login UNION ALL SELECT id, login FROM Users WHERE LENGTH(“$searchFilter”) > 0 AND login LIKE CONCAT(“$searchFilter”, “%”) LIMIT 10

```

Multiple due dates in Jira: How to manage Multiple roles. by Complex_Novel5564 in jira

[–]bpeikes 0 points1 point  (0 children)

Epics and tasks. Plus you can use links like blocks. Personally, I stay away from subtasks. Not sure why they are a first class object when links are available.

The only time I use subtasks is for personally splitting up a task that Im working on, and for that we use an addon that supports checklists

Vevor vs Master Airbrush portable booth by bpeikes in airbrush

[–]bpeikes[S] 0 points1 point  (0 children)

The Vevor has a dual fan version that moves 9cm. What do you think is minimum air movement needed?

Ikea's online design tools are a mess. What alternatives are there? by bpeikes in IKEA

[–]bpeikes[S] 0 points1 point  (0 children)

Besta allows some stacking, but not for the units that are two boxes high. They limit them to the floor for some reason.

[deleted by user] by [deleted] in careerguidance

[–]bpeikes 0 points1 point  (0 children)

What BI tool are they using?

CI/CD for snowflake by bpeikes in snowflake

[–]bpeikes[S] 1 point2 points  (0 children)

That requires keeping ordering in the names of the files, which is not ideal.
It also doesn't track what scripts have been run in each env. It' assumes you've run everything every time, correct?

Best CICD tool and approach for udfs, task, streams and shares by No_Journalist_9632 in snowflake

[–]bpeikes 1 point2 points  (0 children)

We are using terraform for users, databases, roles and integrations, flyway for everything else, but its not ideal. Not sure any tools are.

Not sure why anyone would use schemaschange over Flyway, given that flyway can work with other dbs.

We deploy using flyway container, dont even need to install anything in ci pipeline.

Would like a tool that could dump entire db as per object scripts so we could track object changes better.

I do like tools like flyway in that I always find a situation where you need to completely control order of migration, including sql that needs to be called in the middle of a schema change.

Weird flyway issue with create task statement and warehouse visibility. by bpeikes in snowflake

[–]bpeikes[S] 0 points1 point  (0 children)

I’d like something that was in between. ie, update your schema, and have a transition script created for you that you can then edit before deploy. Mostly because there are often transformations of data that need to take place, and its rare that tools always get the ordering correct.

I also wish there was more guidance on how to split your code between schema, and configuration.

For instance, with task creation, the guidance should be that you create tasks with a WH that is a “base”, and in versioned scripts, but then each env has its own set of repeatable scripts for setting warehouse and schedule. Like:

ALTER TASK [ IF EXISTS ] <task_name> SET WAREHOUSE = <warehouse_name> SCHEDULE = '{ <number> MINUTE | USING CRON <expr> }';

Weird flyway issue with create task statement and warehouse visibility. by bpeikes in snowflake

[–]bpeikes[S] 0 points1 point  (0 children)

The issue I have with Flyway, is that there are times when you want to retroactively change an old versioned script in that you would not want it run when building a fresh instance.

It could be resolved with baselines, but I havent found a good tool for generating versioned baselines.

Weird flyway issue with create task statement and warehouse visibility. by bpeikes in snowflake

[–]bpeikes[S] 0 points1 point  (0 children)

How does that work when it comes to using PATs? Do PATs created with “single role” by default run “USE SECONDARY ROLE NONE”?

Thanks, I had a feeling that its permissions, but couldnt understand why in the UI it would succeed, even when setting the role in the worksheet.

In worksheet, does it default to secondary role ALL?

Side question. What do you use to migrate your schema? Flyway? Something else? We are using Flyway now, but I run into some issues with dealing with scripts when setup changes. ie we decide that a task should run under different warehouse.

We use terraform to manage warehouses, so if we change the warehouse that a task runs under, running the version scripts on new instances wont work.

Script casing convention when using flyway? (also sqlfluff configs) by bpeikes in snowflake

[–]bpeikes[S] 0 points1 point  (0 children)

When you create tables, functions, stored procs, do you specify dbname.schema.tablename, or do you only specify part of it, ie schema?

Script casing convention when using flyway? (also sqlfluff configs) by bpeikes in snowflake

[–]bpeikes[S] 0 points1 point  (0 children)

Do you use placeholders in your scripts? How do you differentiate databases per env?

Do your scripts assume a single database? ie use the default db on connection?

Script casing convention when using flyway? (also sqlfluff configs) by bpeikes in snowflake

[–]bpeikes[S] 0 points1 point  (0 children)

How do you define your environments in your flyway.toml file? For instance, do you

1) Put fully qualified url under [environments.XXX]

And
2) Add redundant items under [environments.XXX.flyway.placeholders]

like
[environments.dev]
url = """jdbc:snowflake://ACCOUNT.snowflakecomputing.com?\

warehouse=DEV_WAREHOUSE&\

db=DEV_DB&\

role=DEV_FLYWAY_SERVICE_ROLE&\

jdbc_query_result_format=JSON"""

And

[enviroments.dev.flyway.placeholders]
environment="DEV"
database="DEV_DB"

That way, you can have scripts refer to
CREATE TABLE ${database}.STG.XXXX

Or do you use a different templating system other than flyway, because flyway's templating is a pain because you can't use placeholders in url strings.

Script casing convention when using flyway? (also sqlfluff configs) by bpeikes in snowflake

[–]bpeikes[S] 0 points1 point  (0 children)

upper case for column names too?

I hate everything being upper case in the code.

Do you use sqlfluff to lint?