Code Monkey home page Code Monkey logo

fynydd / sqribe Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 2.0 175.65 MB

.NET 7.0 C# CLI for backup, restore, scripting, and versioning MS SQL Server (MSSQL) databases on Windows, macOS, and Linux

Home Page: https://sqribe.app

License: GNU General Public License v3.0

Shell 0.77% C# 91.67% TSQL 6.69% Batchfile 0.62% PowerShell 0.25%
applesilicon backup csharp dotnet dotnet-core dotnet5 linux mac macos mssql restore scripts sql-server sql-server-database sqlserver windows windows10 x64

sqribe's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

cashwu soundarrbt

sqribe's Issues

Checking connection to database server ➜ DATABASE IS UNAVAILABLE!

sqribe for openEuler 提示如下错误,同一网络下的Windows 10里可以正常备份数据库。
Linux 已经安装了 [ODBC Driver 18 for SQL Server]
Press [Y] or [ENTER] to backup, any other key to cancel…
(press [Control]+[C] or [Esc] to abort the backup at any time)
• Checking network ➜ OK
• Checking connection to database server ➜ DATABASE IS UNAVAILABLE!
BACKUP PROCESS ABORTED!
Backup aborted on 周三-29-6月-2022 @ 9:34 下午
Total time: 0s

It does not save data (content)

I am facing a problem. It seems the tool does not saves the data (content) of the tables.

CleanShot 2024-01-30 at 16 06 30

It can connect, and my database has data:

CleanShot 2024-01-30 at 16 06 37

What could go wrong?

CleanShot 2024-01-30 at 16 07 18

My back job file:
CleanShot 2024-01-30 at 16 11 40

I am using:

  • OSX Ventura 13.3.1 (a) (22E772610a)
  • SQRIBE for SQL Server 1.7.3.0 for macOS X64 (CLR 7.0.5)

Thanks in advance!

Sqribe is suitable for cloud server backup database.

Sqribe is suitable for cloud server backup database.

My usage scenario is that there are about 20 databases running in the cloud server, which are backed up to the local Linux server once a week. Testing a library in Windows 10 took 10 hours, backed up about 3.5 GIGABytes of data, and wasn't done yet.

Timeout during datbase backup

I tried to backup one of my azure sql databases and after about 2 minutes it just stops and says aborted for the tasks 1 by one.

When I check the log this seems to be because of a timeout, could we make this a configurable timeout perhaps?

image

Backed up indices does not keep 'where' clauses

When backing up tables with indices containing a WHERE clause, the condition does not get saved.
This is an issue for me since I have a DB with a "unique if not NULL" constraint that doesn't get backed up properly.

Example (SQLServer).
Create the following table in a database:

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON

DROP TABLE IF EXISTS test
GO 

CREATE TABLE test(
    id int PRIMARY KEY,
    nullable_key varchar(255) NULL
)
GO

CREATE UNIQUE INDEX uqn_index_nullable_key
  ON test(nullable_key)
  WHERE nullable_key IS NOT NULL
GO

INSERT INTO test VALUES (0, 'a'), (1, NULL), (2, NULL)
GO

Creating a backup on this database using SQribe results in the following TableIndexes.sql file:

SET NUMERIC_ROUNDABORT OFF
SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON
SET XACT_ABORT ON
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
GO -- SQRIBE/GO;4bae80
PRINT N'CREATE indices'
GO -- SQRIBE/GO;4bae80
-- SQRIBE/OBJ;4bae80
CREATE UNIQUE NONCLUSTERED INDEX [uqn_index_nullable_key] ON [dbo].[test] ([nullable_key] ASC) 
WITH (PAD_INDEX=OFF, ALLOW_PAGE_LOCKS=ON, ALLOW_ROW_LOCKS=ON, STATISTICS_NORECOMPUTE=OFF, IGNORE_DUP_KEY=OFF, SORT_IN_TEMPDB=OFF, FILLFACTOR=100) ON [PRIMARY];

GO -- SQRIBE/GO;4bae80

We can see that the generated file does not keep the WHERE nullable_key IS NOT NULL part, which result in a failing restoration due to duplicate NULL values violating the index.

- EXCEPTION: Helpers.OpenExec(); One or more errors occurred. (The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.test' and the index name 'uqn_index_nullable_key'. The duplicate key value is (<NULL>).)

Any way this could get resolved, and is there a workaround that I can use in the meantime?
Thanks in advance!

Support for custom port

Currently the port is hard coded to 1433. Is it possible to include a parameter port to pass the custom port number

eg:
> sqribe backup /data_source:"server=localhost;port=2020;database=AdventureWorks2017;user id=aw2017user;password='abracadabra';" /objects:"all" /output_path:"~/Desktop/sqribe-backup"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.