From 88b0c1ffc2098ea55bb9fa6fa444c37c35e9811d Mon Sep 17 00:00:00 2001 From: pro100ton Date: Sun, 2 Feb 2025 15:58:28 +0300 Subject: [PATCH] Add python snippet for creating sqlalchemy table --- lua/custom/snippets/python.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lua/custom/snippets/python.lua b/lua/custom/snippets/python.lua index 8540877..88fcb42 100644 --- a/lua/custom/snippets/python.lua +++ b/lua/custom/snippets/python.lua @@ -14,6 +14,24 @@ local fmta = require("luasnip.extras.fmt").fmta local rep = require("luasnip.extras").rep ls.add_snippets("python", { + s( + { trig = "ctable", dscr = "Create method or function with test stub" }, + fmt( + [[ + {} = Table( + "{}", + metadata_obj, + Column("id", Integer, primary_key=True), + {} + ) + ]], + { + i(1), + rep(1), + i(0) + } + ) + ), s({ trig = "cmethod", dscr = "Create method or function with test stub" }, fmta( [[