我的数据库有表,视图和所有.我需要一种以自动方式为所有DDL生成SQL脚本的方法.不需要数据.
存在FK约束,因此应该正确地订购表创建脚本.某些视图使用另一个视图,因此还必须正确排序视图创建脚本.
从MSDN博客上提供的脚本开始,我得到以下内容:
function Generate-SqlScript
{
param(
[string]$srvname,
[string]$database,
[string]$ScriptOutputFileName
)
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | out-null
$srv = New-Object ("Microsoft.SqlServer.Management.SMO.Server") ($srvname)
$allUrns = @()
$allUrns += $srv.Databases[$database].Tables | foreach { $_.Urn}
$allUrns += $srv.Databases[$database].Views | foreach { $_.Urn}
$scriptingOptions = New-Object ("Microsoft.SqlServer.Management.SMO.ScriptingOptions")
$scriptingOptions.WithDependencies = $true
$scriptingOptions.AllowSystemObjects = $false
$scriptingOptions.ToFileOnly = $true
$scriptingOptions.Permissions = $true
$scriptingOptions.FileName = "$ScriptOutputFileName"
$scripter = New-Object ("Microsoft.SqlServer.Management.SMO.Scripter") ($srv)
$scripter.Options = $scriptingOptions;
$scripter.Script($allUrns)
}
Generate-SqlScript .\sqlexpress <MyDbName> <FilePath>
Run Code Online (Sandbox Code Playgroud)
现在问题是,WithDependencies选项导致视图脚本包含其先前已包含的依赖表.如果我取出WithDependencies选项,生成的脚本不会反映正确的顺序.
所以最终结果包含所有信息,但它不可运行.它会引发错误,因为它无法创建表两次.
我找到了太多关于SMO脚本编写器的帖子,所以我认为必须有一些我错过的东西.或者......所有这些帖子都错过了这个问题吗?
我有一个覆盖整个屏幕的视图(比方说ParentView),以及ChildView仅覆盖其中一部分的子内部视图。我要做出ChildView回应onSingleTapUp(),同时ParentView回应onFling()。我试图通过附加一个SimpleOnGestureListener和ChildView一个SimpleOnGestureListener来做到这一点ParentView。
要接受onSingleTapUp()from ChildView,其侦听器onDown()必须返回 true。但是一旦我这样做了,绑定的侦听器ParentView就不会再听到任何运动事件,因为它是由 的ChildView侦听器获取的。即使ChildView'sonFling()返回 false,事件也不会流到ParentView's 侦听器。
如何使父视图的侦听器捕获 fling 手势,同时子视图的侦听器捕获点击手势?
我认为不需要任何源代码来解释这种情况,但这里有一个设置我的ChildView监听器的片段。
ChildView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
return singleTapGestureDetector.onTouchEvent(motionEvent);
}
});
Run Code Online (Sandbox Code Playgroud)
一种解决方法可能是同时让ParentView和ChildView的侦听器处理onFling()while onlyChildView的侦听器句柄onSingleTapUp(),但在这种情况下,fling 将无法跨过发生ChildView(例如从子项外部开始,然后在子项内结束),我相信。
ag-grid 网站上的 ag-grid-vue 文档清楚地说明:
您可以在 Grid 中提供 Vue Router 链接,但您需要确保为正在创建的 Grid 组件提供一个 Router。
带有示例代码:
// create a new VueRouter, or make the "root" Router available
import VueRouter from "vue-router";
const router = new VueRouter();
// pass a valid Router object to the Vue grid components to be used within the grid
components: {
'ag-grid-vue': AgGridVue,
'link-component': {
router,
template: '<router-link to="/master-detail">Jump to Master/Detail</router-link>'
}
},
// You can now use Vue Router links within you Vue Components within the …Run Code Online (Sandbox Code Playgroud) 以下茉莉花测试适用于PhantomJS或Chrome,但不适用于MSIE 10.
describe("utility", function () {
var utility = {
// { A: true, B: true } will become 'AB'
CombineValues: function (splitValues) {
var combined = '';
for (item in splitValues) { // on IE, item is a function, not a string
if (splitValues[item]) // on IE, this returns false all the time
combined = combined + item;
}
return combined;
},
// 'AB' will become { A: true, B: true }
SplitValues: function (combined) {
var splitValues = …Run Code Online (Sandbox Code Playgroud) ag-grid ×1
android ×1
gesture ×1
javascript ×1
powershell ×1
smo ×1
sql-server ×1
vue-router ×1