@@ -262,109 +262,6 @@ export const ensureSqlmeshEnterpriseInstalled = async (): Promise<
262262 return installationLock
263263}
264264
265- /**
266- * Get the sqlmesh executable for the current workspace.
267- *
268- * @deprecated Use LSP instead of direct sqlmesh execution for any new functionality.
269- */
270- export const sqlmeshExec = async ( ) : Promise <
271- Result < SqlmeshExecInfo , ErrorType >
272- > => {
273- const sqlmesh = IS_WINDOWS ? 'sqlmesh.exe' : 'sqlmesh'
274- const projectRoot = await getProjectRoot ( )
275- const resolvedPath = resolveProjectPath ( projectRoot )
276- if ( isErr ( resolvedPath ) ) {
277- return err ( {
278- type : 'generic' ,
279- message : resolvedPath . error ,
280- } )
281- }
282- const envVariables = await getPythonEnvVariables ( )
283- if ( isErr ( envVariables ) ) {
284- return err ( {
285- type : 'generic' ,
286- message : envVariables . error ,
287- } )
288- }
289- const workspacePath = resolvedPath . value
290- const interpreterDetails = await getInterpreterDetails ( )
291- traceLog ( `Interpreter details: ${ JSON . stringify ( interpreterDetails ) } ` )
292- if ( interpreterDetails . path ) {
293- traceVerbose (
294- `Using interpreter from Python extension: ${ interpreterDetails . path . join (
295- ' ' ,
296- ) } `,
297- )
298- }
299- if ( interpreterDetails . isVirtualEnvironment ) {
300- traceLog ( 'Using virtual environment' )
301- const isTcloudInstalled = await isTcloudProject ( )
302- if ( isErr ( isTcloudInstalled ) ) {
303- return err ( {
304- type : 'generic' ,
305- message : isTcloudInstalled . error ,
306- } )
307- }
308- if ( isTcloudInstalled . value ) {
309- const tcloudBin = await getTcloudBin ( )
310- if ( isErr ( tcloudBin ) ) {
311- return tcloudBin
312- }
313- const isSignedIn = await isSignedIntoTobikoCloud ( )
314- if ( ! isSignedIn ) {
315- return err ( {
316- type : 'not_signed_in' ,
317- } )
318- }
319- const ensured = await ensureSqlmeshEnterpriseInstalled ( )
320- if ( isErr ( ensured ) ) {
321- return ensured
322- }
323- return ok ( {
324- bin : tcloudBin . value . bin ,
325- workspacePath,
326- env : tcloudBin . value . env ,
327- args : [ "sqlmesh" ] ,
328- } )
329- }
330- const binPath = path . join ( interpreterDetails . binPath ! , sqlmesh )
331- traceLog ( `Bin path: ${ binPath } ` )
332- const env = await getSqlmeshEnvironment ( )
333- if ( isErr ( env ) ) {
334- return err ( {
335- type : 'generic' ,
336- message : env . error ,
337- } )
338- }
339- return ok ( {
340- bin : binPath ,
341- workspacePath,
342- env : env . value ,
343- args : [ ] ,
344- } )
345- } else {
346- const exists = await doesExecutableExist ( sqlmesh )
347- if ( ! exists ) {
348- return err ( {
349- type : 'sqlmesh_not_found' ,
350- } )
351- }
352- const env = await getSqlmeshEnvironment ( )
353- if ( isErr ( env ) ) {
354- return err ( {
355- type : 'generic' ,
356- message : env . error ,
357- } )
358- }
359- return ok ( {
360- bin : sqlmesh ,
361- workspacePath,
362- env : env . value ,
363- args : [ ] ,
364- } )
365- }
366- }
367-
368265/**
369266 * Ensure that the sqlmesh_lsp dependencies are installed.
370267 *
0 commit comments