/// <summary>
        /// Generates SQL post deployment script that pushes R code into a table
        /// as well as 
        /// </summary>
        private void CreatePostDeploymentScriptFile(SqlSProcPublishSettings settings, 
            EnvDTE.Project targetProject, string targetFolder, 
            EnvDTE.ProjectItem targetProjectItem, SProcMap sprocMap) {
            var postDeploymentScript = Path.Combine(targetFolder, PostDeploymentScriptName);

            var g = new SProcScriptGenerator(_fs);
            var script = g.CreatePostDeploymentScript(settings, sprocMap);

            _fs.WriteAllText(postDeploymentScript, script);

            var item = targetProjectItem.ProjectItems.AddFromFile(postDeploymentScript);
            item.Properties.Item("BuildAction").Value = "PostDeploy";
        }
Beispiel #2
0
        private void CreateDacPac(SqlSProcPublishSettings settings, IEnumerable <string> sprocFiles, string dacpacPath)
        {
            var project  = _pss.GetSelectedProject <IVsHierarchy>()?.GetDTEProject();
            var g        = new SProcScriptGenerator(_fs);
            var sprocMap = g.CreateStoredProcedureScripts(settings, sprocFiles);
            var builder  = _dacServices.GetBuilder(_appShell);

            builder.Build(dacpacPath, project.Name, sprocMap.Scripts);
        }
        /// <summary>
        /// Create SQL file that defines table template that will hold R code
        /// </summary>
        internal void CreateRCodeTableFile(SqlSProcPublishSettings settings, EnvDTE.Project targetProject, string targetFolder, EnvDTE.ProjectItem targetProjectItem) {
            var creatTableScriptFile = Path.Combine(targetFolder, CreateRCodeTableScriptName);

            var g = new SProcScriptGenerator(_fs);
            var script = g.CreateRCodeTableScript(settings);

            _fs.WriteAllText(creatTableScriptFile, script);
            targetProjectItem.ProjectItems.AddFromFile(creatTableScriptFile);
        }
Beispiel #4
0
        /// <summary>
        /// Create SQL file that defines table template that will hold R code
        /// </summary>
        internal void CreateRCodeTableFile(SqlSProcPublishSettings settings, EnvDTE.Project targetProject, string targetFolder, EnvDTE.ProjectItem targetProjectItem)
        {
            var creatTableScriptFile = Path.Combine(targetFolder, CreateRCodeTableScriptName);

            var g      = new SProcScriptGenerator(_fs);
            var script = g.CreateRCodeTableScript(settings);

            _fs.WriteAllText(creatTableScriptFile, script);
            targetProjectItem.ProjectItems.AddFromFile(creatTableScriptFile);
        }
Beispiel #5
0
        /// <summary>
        /// Generates SQL post deployment script that pushes R code into a table
        /// as well as
        /// </summary>
        private void CreatePostDeploymentScriptFile(SqlSProcPublishSettings settings,
                                                    EnvDTE.Project targetProject, string targetFolder,
                                                    EnvDTE.ProjectItem targetProjectItem, SProcMap sprocMap)
        {
            var postDeploymentScript = Path.Combine(targetFolder, PostDeploymentScriptName);

            var g      = new SProcScriptGenerator(_fs);
            var script = g.CreatePostDeploymentScript(settings, sprocMap);

            _fs.WriteAllText(postDeploymentScript, script);

            var item = targetProjectItem.ProjectItems.AddFromFile(postDeploymentScript);

            item.Properties.Item("BuildAction").Value = "PostDeploy";
        }
        private SProcMap CreateStoredProcedureFiles(SqlSProcPublishSettings settings, IEnumerable<string> sprocFiles, string targetFolder, EnvDTE.ProjectItem targetProjectItem) {
            var g = new SProcScriptGenerator(_fs);

            var sprocMap = g.CreateStoredProcedureScripts(settings, sprocFiles);

            foreach (var name in sprocMap) {
                var template = sprocMap[name];
                if (!string.IsNullOrEmpty(template)) {
                    var sprocFile = Path.ChangeExtension(Path.Combine(targetFolder, name), ".sql");
                    _fs.WriteAllText(sprocFile, template);
                    targetProjectItem.ProjectItems.AddFromFile(sprocFile);
                }
            }
            return sprocMap;
        }
Beispiel #7
0
        private SProcMap CreateStoredProcedureFiles(SqlSProcPublishSettings settings, IEnumerable <string> sprocFiles, string targetFolder, EnvDTE.ProjectItem targetProjectItem)
        {
            var g = new SProcScriptGenerator(_fs);

            var sprocMap = g.CreateStoredProcedureScripts(settings, sprocFiles);

            foreach (var name in sprocMap)
            {
                var template = sprocMap[name];
                if (!string.IsNullOrEmpty(template))
                {
                    var sprocFile = Path.ChangeExtension(Path.Combine(targetFolder, name), ".sql");
                    _fs.WriteAllText(sprocFile, template);
                    targetProjectItem.ProjectItems.AddFromFile(sprocFile);
                }
            }
            return(sprocMap);
        }
Beispiel #8
0
 private void CreateDacPac(SqlSProcPublishSettings settings, IEnumerable<string> sprocFiles, string dacpacPath) {
     var project = _pss.GetSelectedProject<IVsHierarchy>()?.GetDTEProject();
     if (project != null) {
         var g = new SProcScriptGenerator(_fs);
         var sprocMap = g.CreateStoredProcedureScripts(settings, sprocFiles);
         var builder = _dacServices.GetBuilder();
         builder.Build(dacpacPath, project.Name, sprocMap.Scripts);
     }
 }