Skip to content

Commit

Permalink
order by created_at desc limit 1 (teaxyz#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchitram1 authored Oct 22, 2024
1 parent 8f9b926 commit bf5ab10
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
58 changes: 58 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]

# Same as Black.
line-length = 88
indent-width = 4

# Assume Python 3.8
target-version = "py38"

[lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E", "F", "I"]
ignore = []
fixable = ["ALL"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[lint.per-file-ignores]
"__init__.py" = ["E402", "F401"] # unused imports, and top level imports
"sls/alembic/versions/*" = ["E501"] # ignore long lines for migrations

[format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = true
docstring-code-line-length = "dynamic"
2 changes: 1 addition & 1 deletion package_managers/homebrew/jq/dependencies.jq
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
select(.depends_on | type == "string") |
# generate the sql statements!
"INSERT INTO dependencies (version_id, dependency_id, dependency_type_id) VALUES (
(SELECT id FROM versions WHERE import_id = '" + .package_name + "'),
(SELECT id FROM versions WHERE import_id = '" + .package_name + "' ORDER BY created_at DESC LIMIT 1),
(SELECT id FROM packages WHERE import_id = '" + .depends_on + "'),
'" + .depends_on_type + "') ON CONFLICT DO NOTHING;"
] | join("\n")

0 comments on commit bf5ab10

Please sign in to comment.